Username: Posted September 20, 2010 Share Posted September 20, 2010 Right now I just cheated and sorted by descending then put like thirty <br />'s so you couldn't see old ones. How can I do this properly? Quote Link to comment Share on other sites More sharing options...
litebearer Posted September 20, 2010 Share Posted September 20, 2010 helps if you show us your code Quote Link to comment Share on other sites More sharing options...
Username: Posted September 20, 2010 Author Share Posted September 20, 2010 helps if you show us your code lol i told you exactly what i did. <div id="html1" style="font-family:arial; font-size: 12px"> <?php mysql_connect("mysql", "15557_test", "********") or die("Could not connect: " . mysql_error()); mysql_select_db("15557_test"); $result = mysql_query("SELECT id FROM total ORDER BY id DESC"); while ($row = mysql_fetch_array($result, MYSQL_NUM)) { printf("<font color='white'>Total post count (since this was added): %s<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></font>", $row[0]); } mysql_free_result($result); ?> Quote Link to comment Share on other sites More sharing options...
litebearer Posted September 20, 2010 Share Posted September 20, 2010 use LIMIT 1 in your query. In your case only the highest ID will be returned. IF the ID is auto increment, then that will be the most recent addition to your table Quote Link to comment Share on other sites More sharing options...
Username: Posted September 20, 2010 Author Share Posted September 20, 2010 use LIMIT 1 in your query. In your case only the highest ID will be returned. IF the ID is auto increment, then that will be the most recent addition to your table Thanks for the fast answer, it works great ! 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.