Jump to content

Archived

This topic is now archived and is closed to further replies.

mjm037

Mysql Help

Recommended Posts

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!!

Share this post


Link to post
Share on other sites
$sql = "SELECT * FROM myTable WHERE Quantity BETWEEN 1 AND 11



That 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 :)

Regards
Liam

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.