Vivid Lust Posted April 7, 2008 Share Posted April 7, 2008 Currently making a shout thingy; basically a guesbook I have the code: <?php $query=mysql_query("SELECT name,location,shout FROM shout") or die(mysql_error()); while($row=mysql_fetch_assoc($query)){ echo "<b>Name: </b>"; echo $row['name'].'<br>'; echo "<b>Location: </b>"; echo $row['location'].'<br>'; echo "<b>Shout: </b>"; echo $row['shout'].'<br>'; echo "<center>- - - - - - - - - -</center>"; } ?> How can i fetch the data so that the highest id appears fist? as now it is in the other order. Thanks. Link to comment https://forums.phpfreaks.com/topic/99994-order-fetch/ Share on other sites More sharing options...
rhodesa Posted April 7, 2008 Share Posted April 7, 2008 If your 'id' column is named id, it would be: $query=mysql_query("SELECT name,location,shout FROM shout ORDER BY id DESC") Link to comment https://forums.phpfreaks.com/topic/99994-order-fetch/#findComment-511336 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.