ORDER BY question
Posted 19 April 2006 - 04:49 PM
I recently added a new record to a table that feeds my php-based resume. Because the key is auto increment, the new record fell to the bottom of the list but I want it to appear at the top so I bumped all the key values for the existing records and set the new record to have the lowest value in the key field. However, when I refresh my url the new record appears at the bottom. Why is this? I've confirmed via phpMyAdmin and mySQL that the changes to the records took but still no love. I have also tried inserting an ORDER BY command into the php of the page itself but, again, no love. What gives? Any ideas?
Posted 19 April 2006 - 05:09 PM
(Gone until 20 to November)
Posted 19 April 2006 - 06:31 PM
Have you tried:[!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']SELECT[/span] * FROM `table` ORDER BY id DESC [!--sql2--][/div][!--sql3--] (When id is the column with the auto_increment) Or something else?
AHA! Thanks, I was trying to put the ORDER BY in a separate command. Many thanks.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users