ORDER BY is not sorting
| From: | Mark Abrams | Date: | Tue, 31 Jul 2007 19:42:44 +0000 |
| Subject: | ORDER BY is not sorting | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-28291@lists.php.net to get a copy of this message | ||
Sorry, this seams very trivial but I can not sort the result set for any
field. What am I doing wrong?
php & mySQL 5
<?php
...
$table_name ='users';
// Select records
$result = mysql_query("SELECT * FROM $table_name ORDER BY rowID DESC");
// Loop through the record set
while($row = mysql_fetch_array($result)) {
print 'rowID =' .$row['rowID']. '<br />'
}
?>
1
2
3
4
TIA
Mark