AbydosGater Posted October 7, 2006 Share Posted October 7, 2006 Hi, Sorry for the topic name!, bit confusing... ButHeres my script...[code] $query = "SELECT * FROM ben_news ORDER BY id"; $result = mysql_query($query); while($news = mysql_fetch_array($result)) {$member_id = $news['member_id'];$author = "SELECT username FROM ben_users WHERE member_id='$member_id'"; $authorresult = mysql_query($author); $authorinfo = mysql_fetch_array( $authorresult );echo "<table width='455' border='0' cellspacing='0' cellpadding='0' background='image/longmenu.gif' height='34'> <tr> <td><FONT FACE='Tahoma'><b>" . $news['title'] . "</b></FONT></td> </tr> </table> ";echo "<p>";echo $news['content'];echo "</p>";echo "<p>"; echo "<hr><br>"; echo "Author: " . $authorinfo['username'] . " " . "Date/Time: " . $news['timedate'];echo "</p>";};};[/code]Right no need to read all of that, but the Important bit is $query = "SELECT * FROM ben_news ORDER BY id";The id field is an Auto Int.. And it all works fine! but i was wondering how do i get it to order backwards? start with the highest number, 5,4,3,2,1... and so on???ThanksAbydos Quote Link to comment Share on other sites More sharing options...
redarrow Posted October 7, 2006 Share Posted October 7, 2006 DESCorASC Quote Link to comment Share on other sites More sharing options...
AbydosGater Posted October 7, 2006 Author Share Posted October 7, 2006 Ok, Thanks, but where does that go? Quote Link to comment Share on other sites More sharing options...
redarrow Posted October 7, 2006 Share Posted October 7, 2006 $query = "SELECT * FROM ben_news ORDER BY id ASC";or$query = "SELECT * FROM ben_news ORDER BY id DESC";This link is for you ok.http://www.1keydata.com/sql/sql-syntax.html Quote Link to comment Share on other sites More sharing options...
AbydosGater Posted October 7, 2006 Author Share Posted October 7, 2006 Have It, Thanks very much, fast reply! Quote Link to comment Share on other sites More sharing options...
redarrow Posted October 7, 2006 Share Posted October 7, 2006 good luck but use the link i provided for mysql as it the best ever mysql website for learning i have ever seen. Quote Link to comment 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.