views:

58

answers:

2

The sql query is

$query = mysql_query( "SELECT * FROM games ORDER BY gamename" );

But it doesn't order them by the gamename. This is a sample of the database

id (int) | gamename (text) | gameurl (varchar) | width (int) | height (int)

1--------- Copter ---------- copter ----------- 100 ---------- 200--------

2--------- Adrenaline ------ adr -------------- 200 ---------- 300--------
A: 

Perhaps there's a space before the C in Copter?

joshtronic
Fixed now, silly mistake by me. Thanks for the help
Liam
+1  A: 

Can you provide us a slightly longer sample list? Also when you say it doesn't order are you trying to go ascending or descending? By default it sorts Ascending. You need to say ORDER BY gamename DESC to get it to do it descending...

Also while not required i'd advise wrapping the orderby field in an UPPER i.e. order by UPPER(gamename) so that Upper/Lower case letters are treated equally.

CogitoErgoSum