I was wondering if anyone could help me with this minor problem.
I want to select something from the database, where the number is not more than a set number.
This is what i have (snippet):
$Level = "1"; //Retrieved from the DB, just keeping it simple.
@$Query = mysql_query("SELECT * FROM users,store WHERE users.ID = '$ID' AND store.LevelReq <='users.Level'");
The problem with this, it doesn’t display anything that equals $level.
(Item … Level: 0) – Displays
(Item … Level: 1) – Doesn’t display.
So what i’d like is the equivalent of php’s !>1 (not more than 1) but in MYSQL format if possible, however this doesn’t work.
You should remember that ‘not more than’ is always the same as ‘lower than and equal to’, so you should use
field <= value. (So in your case:field <= 1.)