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
https://forums.phpfreaks.com/topic/176813-solved-longtext-trouble/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.