Sort alphabetically
Posted: Fri Jan 16, 2009 12:27 pm
So i use the following line to get the data, they choose a letter to search from and it selects all games starting with that letter:
Now at the moment it just sorts it using the ID, so basically what order they were put into the database. I want to sort it so they appear alphabetically, i had a look at the sort function but wasnt sure how to get the result ito an array so if someone wants to explain...
EDIT: Just looked at my code and i do have the 'mysql_fetch_array' so that means $result is infact an array, now what do i do to sort that?
Thanks!
Oscardog
Code: Select all
$result = mysql_query("SELECT * FROM games WHERE startletter = '".$lettersort."'");EDIT: Just looked at my code and i do have the 'mysql_fetch_array' so that means $result is infact an array, now what do i do to sort that?
Thanks!
Oscardog