rnb_cassanova Posted January 29, 2008 Share Posted January 29, 2008 Hi guys, I have got a mysql database displaying in PHP but everytime a row is added, they do not order by the auto increment ID, but all random instead. Can anyone have an idea how to put them in descending order? My Code - <?php While($row = mysql_fetch_array($result)) { ?> <tr> <td width="78"><div align="center"><?php echo $row['ProposalID']?></div></td> <td width="103"><div align="center"><?php echo $row['Name']?> </div></td> Thanks Guys Quote Link to comment https://forums.phpfreaks.com/topic/88359-solved-rows-displaying-randomly-in-php/ Share on other sites More sharing options...
themistral Posted January 29, 2008 Share Posted January 29, 2008 You will need to add the order by option on your query $query = SELECT * FROM table ORDER BY fieldname DESC Quote Link to comment https://forums.phpfreaks.com/topic/88359-solved-rows-displaying-randomly-in-php/#findComment-452189 Share on other sites More sharing options...
rnb_cassanova Posted January 29, 2008 Author Share Posted January 29, 2008 Brilliant! Thanks for the reply. Quote Link to comment https://forums.phpfreaks.com/topic/88359-solved-rows-displaying-randomly-in-php/#findComment-452272 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.