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!! Link to comment https://forums.phpfreaks.com/topic/6467-mysql-help/ 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 Link to comment https://forums.phpfreaks.com/topic/6467-mysql-help/#findComment-23452 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.