...

View Full Version : newb question about ORDER BY



Tidus
08-03-2002, 11:55 AM
Hello.

I would like to know how to order something alphabetically.
I have made a database with lyrics - song titles and words. And I have made it so the page lists all the songs that are there, but i would like to know how to sort the alphabetically.
Here is a sample of the code!




// show lyrics list

$result = mysql_query("SELECT * FROM lyrics ORDER BY title ??? ",$db);

if ($myrow = mysql_fetch_array($result)) {


Thank you very much!

SYP}{ER
08-03-2002, 12:08 PM
$result = mysql_query("SELECT * FROM lyrics ORDER BY title ASC",$db);

That'll list them a, b, c, etc.

$result = mysql_query("SELECT * FROM lyrics ORDER BY title DESC",$db);

That'll list them z,y,x, etc.

:)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum