SirChick Posted January 11, 2008 Share Posted January 11, 2008 How would go about selecting the most recent row when sorted by "timestamp" in a query ? Is it ORDER BY ASC TimeStampField ... then just mysql_fetch_assoc for the first row? Link to comment https://forums.phpfreaks.com/topic/85604-solved-selecting-the-most-newest-row/ Share on other sites More sharing options...
drummer101 Posted January 11, 2008 Share Posted January 11, 2008 it would be DESC Link to comment https://forums.phpfreaks.com/topic/85604-solved-selecting-the-most-newest-row/#findComment-436870 Share on other sites More sharing options...
SirChick Posted January 11, 2008 Author Share Posted January 11, 2008 oh yeh ! Good point lol thanks ! Link to comment https://forums.phpfreaks.com/topic/85604-solved-selecting-the-most-newest-row/#findComment-436875 Share on other sites More sharing options...
trq Posted January 11, 2008 Share Posted January 11, 2008 SELECT fld FROM tbl ORDER BY stamp LIMIT 1; Link to comment https://forums.phpfreaks.com/topic/85604-solved-selecting-the-most-newest-row/#findComment-436880 Share on other sites More sharing options...
SirChick Posted January 12, 2008 Author Share Posted January 12, 2008 LIMIT 1 ! So thats what i was meant to put! I kept putting Limit = 1 ! heh Thankyou thorpe! Link to comment https://forums.phpfreaks.com/topic/85604-solved-selecting-the-most-newest-row/#findComment-436934 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.