I want to call a list of all the usernames in a database.
$sql = "SELECT username FROM profile";
$result = @mysql_query($sql);
if (! $result) {
print "Error performing query: " . mysql_error();
exit();
}
Now, to just list all these values in the order in which they are stored, I would do:
while ( $row = mysql_fetch_array($result)) {
print $row["username"] . "<BR>";
}
But how can I get them to print in alphabetical order?
Cheers,