i have a script that posts the id's onto a page, the only problem is that it posts the highest id number last.
i would like it to post the highest id number first and the lowest last
heres my script
<th><font face="Ar开发者_如何学Pythonial, Helvetica, sans-serif">id</font></th>
$f1=mysql_result($result,$i,"id");
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font></td>
this code above does a great job of getting the id from my mysql db
if this makes no sense please tell me and ill try to explain is in another way
Put this at the end of your query
Order by Id Desc
SELECT * FROM table WHERE 1 ORDER BY id DESC
That should be done in your SQL query.
Example:
SELECT * FROM table ORDER BY id DESC;
The ORDER BY clause will do perfectly.
精彩评论