Jump to content

[SOLVED] longtext trouble.


stevebluck

Recommended Posts

Hello,

 

one of my mysql fields is called "meta_value" and has a type of "longtext". Sometimes I need to use a query to see if an integer is equal to or greater than another integer within this field like so:

 

$price = "p3.meta_key='price_value' AND p3.meta_value >= '150000";

 

This obviously does not work because its simply matching the text rather then the value of the integer. So this query would return values such as:

 

150000

400

400000

 

Which is not what I want. I want to keep the field as "longtext" but somehow treat the value as an integer type when I need to.

 

The value will always be an integer in the price_value meta_key.

 

I'm sure it's an easy fix!

 

Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.