liamloveslearning Posted May 27, 2010 Share Posted May 27, 2010 Hi all, I need to select the highest date out of my table where user = sessionid. for example, USER SESSION ID = 10 user_ses_id Date 12 2010-05-19 10 2009-12-01 10 2010-05-24 30 2009-05-20 so the value I would be calling is '2010-05-24' Does this make sense? My code im trying is SELECT * FROM model_pictures WHERE user_id = colname ORDER BY model_pictures.user_picture_date DESC LIMIT 1 Link to comment https://forums.phpfreaks.com/topic/203153-select-date-from-table-limit-1/ Share on other sites More sharing options...
Yucky Posted May 28, 2010 Share Posted May 28, 2010 Use: SELECT * FROM model_pictures WHERE user_id = colname ORDER BY str_to_date(user_picture_date, "%Y-%m-%d") DESC LIMIT 1 Link to comment https://forums.phpfreaks.com/topic/203153-select-date-from-table-limit-1/#findComment-1064425 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.