Page 1 of 1

[resolved] Ordering SQL selects by multiple cols

Posted: Fri Jul 28, 2006 4:58 pm
by ibanez270dx
Hi,
I was wondering if there was a way to select the data out of my database and order it by multiple fields. For example:

Code: Select all

SELECT * FROM $table_name WHERE id=$idnum ORDER BY year AND month AND day
So... am I right or is this not the way to do it?

Thanks,
- Jeff

Posted: Fri Jul 28, 2006 5:19 pm
by feyd
swap ANDs for commas.

SQL != PHP. :arrow: Databases.