mjm037 Posted April 3, 2006 Share Posted April 3, 2006 Hey, have a quick problem. am trying to select rows from a database where the quantity is between 0 and 10 (but not 0). can get less than 11:[code]$sql = "SELECT * FROM myTable WHERE Quantity <= 11;" [/code]or more than 0:[code]$sql = "SELECT * FROM myTable WHERE Quantity > 0;" [/code]but dont know the syntax for both at the same time, please help!! Quote Link to comment Share on other sites More sharing options...
shocker-z Posted April 3, 2006 Share Posted April 3, 2006 $sql = "SELECT * FROM myTable WHERE Quantity BETWEEN 1 AND 11That should work :) but the column `Quantity` HAS to be set as INT in the database! else it will treat it just like a word instead of a number :)RegardsLiam 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.