SirChick Posted October 17, 2007 Share Posted October 17, 2007 Are you able to use a less than symbol in a query something like this, so that all business which have less than 2 owners will be selected? $findbusinesses = "SELECT * FROM businesses WHERE TotalOwned<3"; would the < symbol work or no ? Quote Link to comment https://forums.phpfreaks.com/topic/73701-solved-less-than-symbol-in-a-query/ Share on other sites More sharing options...
corbin Posted October 17, 2007 Share Posted October 17, 2007 Yes, that's valid. That would be less than 3 though... Quote Link to comment https://forums.phpfreaks.com/topic/73701-solved-less-than-symbol-in-a-query/#findComment-371860 Share on other sites More sharing options...
yzerman Posted October 17, 2007 Share Posted October 17, 2007 yeah, just make sure you encase the value with single quotes. $findbusinesses = "SELECT * FROM businesses WHERE TotalOwned < '3';"; Quote Link to comment https://forums.phpfreaks.com/topic/73701-solved-less-than-symbol-in-a-query/#findComment-371861 Share on other sites More sharing options...
SirChick Posted October 17, 2007 Author Share Posted October 17, 2007 sorry corbin i put 2 by accident and thanks for the help guys! Quote Link to comment https://forums.phpfreaks.com/topic/73701-solved-less-than-symbol-in-a-query/#findComment-371865 Share on other sites More sharing options...
corbin Posted October 17, 2007 Share Posted October 17, 2007 yeah, just make sure you encase the value with single quotes. $findbusinesses = "SELECT * FROM businesses WHERE TotalOwned < '3';"; Actually, I would not use quotes as numbers should never be an entities name so that won't be a problem, and mysql will have to trim off the quotes anyway. Infact, I can't back this up with a link or anything, but I think you're actually supposed to not put quotes on numbers.... I am wrong quite often though x.x Quote Link to comment https://forums.phpfreaks.com/topic/73701-solved-less-than-symbol-in-a-query/#findComment-371931 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.