Brendan Posted August 13, 2006 Share Posted August 13, 2006 How would i go about searching a mysql database for a value greater than one number and less than or equal to another, and visa versa?For Example if ($price=="3") {$op.="(price>61.00 && price<=100.99)";} This doesnt work of course, but perhaps it will give an idea of what im trying to achieve. Thanks,-Brendan Link to comment https://forums.phpfreaks.com/topic/17433-operators/ Share on other sites More sharing options...
Barand Posted August 13, 2006 Share Posted August 13, 2006 $p1 = 61.00;$p2 = 100.99;... WHERE price > $p1 AND price <= $p2or$p1 = 61.01;$p2 = 100.99;... WHERE price BETWEEN $p1 AND $p2 Link to comment https://forums.phpfreaks.com/topic/17433-operators/#findComment-74220 Share on other sites More sharing options...
Brendan Posted September 1, 2006 Author Share Posted September 1, 2006 where category='1' AND price>'61.00' AND price<='100.99' ORDER BY prod DESCI've tried that, but this doesn't seem to work. Link to comment https://forums.phpfreaks.com/topic/17433-operators/#findComment-84324 Share on other sites More sharing options...
trq Posted September 1, 2006 Share Posted September 1, 2006 What field types are you using? Link to comment https://forums.phpfreaks.com/topic/17433-operators/#findComment-84334 Share on other sites More sharing options...
Barand Posted September 1, 2006 Share Posted September 1, 2006 Define doesn't work.Query gives an error or you don't get the results you expect? Link to comment https://forums.phpfreaks.com/topic/17433-operators/#findComment-84336 Share on other sites More sharing options...
Caesar Posted September 1, 2006 Share Posted September 1, 2006 [quote author=thorpe link=topic=104108.msg426272#msg426272 date=1157152475]What field types are you using?[/quote] Link to comment https://forums.phpfreaks.com/topic/17433-operators/#findComment-84341 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.