Simiie
01-26-2005, 11:39 PM
I need to order a list of names and in ASC order.
Problem is..
in my database i have a table for 'lastname' which I am using to ORDER BY now in ASC
But some of the names dont have a last name and only have a firstname which is stored in the 'firstname' table.
so they show up on the top of the list ( the ones w/o last names)
Is there a way I can write it to say something like...
$namequery = mysql_query("SELECT * FROM teg_names WHERE letter = '$letterofarray' AND updated = 2 ORDER BY lastname, firstname ASC")or die(mysql_error());
thats my best guess at it... need help! :rolleyes:
Problem is..
in my database i have a table for 'lastname' which I am using to ORDER BY now in ASC
But some of the names dont have a last name and only have a firstname which is stored in the 'firstname' table.
so they show up on the top of the list ( the ones w/o last names)
Is there a way I can write it to say something like...
$namequery = mysql_query("SELECT * FROM teg_names WHERE letter = '$letterofarray' AND updated = 2 ORDER BY lastname, firstname ASC")or die(mysql_error());
thats my best guess at it... need help! :rolleyes: