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 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 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. 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
Archived
This topic is now archived and is closed to further replies.