justAnoob Posted January 30, 2010 Share Posted January 30, 2010 just looking to get the 3 most recent records. can't seem to get this. see anything wrong? <?php $sql = mysql_query('SELECT id, category, track_name, username_id FROM tracks WHERE category = "supercross" ORDER BY DESC LIMIT 0, 3'); ?> Link to comment https://forums.phpfreaks.com/topic/190323-help-with-a-line-please/ Share on other sites More sharing options...
trq Posted January 30, 2010 Share Posted January 30, 2010 Your missing a field in your ORDER BY clause. You'll wan't to order by a timestamp field of some sort if you want to sort by most recent. Link to comment https://forums.phpfreaks.com/topic/190323-help-with-a-line-please/#findComment-1004092 Share on other sites More sharing options...
justAnoob Posted January 30, 2010 Author Share Posted January 30, 2010 ooppss, thanks. Link to comment https://forums.phpfreaks.com/topic/190323-help-with-a-line-please/#findComment-1004094 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.