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 Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
trq Posted September 1, 2006 Share Posted September 1, 2006 What field types are you using? Quote Link to comment 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? Quote Link to comment 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] Quote Link to comment 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.