Page 1 of 1

Query Problem!

Posted: Sun Jun 13, 2004 10:34 am
by Joe
I am currently developing my very own who's online script for my site and I came across a small problem. Everything so far works just perfect apart from the fact that my query information isn't going my way. I am trying to create it so names are ordered by name and level. For example level 1 is administrator and level 0 is normal user. I wish for it to show admins first aswell order by the name. It is very complicated to explain this but is there any way of ordering in a query twice like:

$sql = "SELECT * FROM online WHERE time <> '0' ORDER BY name AND ORDER BY level";

Please help? Thanks!

Posted: Sun Jun 13, 2004 10:36 am
by malcolmboston
not sure tbh

try

Code: Select all

ORDER BY name AND GROUP BY level

Posted: Sun Jun 13, 2004 10:52 am
by Joe
Hmm all I got was a query error. I will try to work this out :) Thanks bud!

Posted: Sun Jun 13, 2004 2:44 pm
by launchcode
Your SQL query is incorrect, it should be written as:

$sql = "SELECT * FROM online WHERE time <> '0' ORDER BY name, level";