yanti Posted June 24, 2010 Share Posted June 24, 2010 hi guys..i need help in select function for viewing the newest data/rows. for example: select * from rwmessage where id = '(the newest row)' please help me with the line. Link to comment https://forums.phpfreaks.com/topic/205720-select-new-inserted-rows-in-database-using-id/ Share on other sites More sharing options...
phpchamps Posted June 24, 2010 Share Posted June 24, 2010 select * from tablename order by id desc limit 1 note: id needs to be autoincrement for this query to work Link to comment https://forums.phpfreaks.com/topic/205720-select-new-inserted-rows-in-database-using-id/#findComment-1076493 Share on other sites More sharing options...
yanti Posted June 24, 2010 Author Share Posted June 24, 2010 thanks for that...it worked. Link to comment https://forums.phpfreaks.com/topic/205720-select-new-inserted-rows-in-database-using-id/#findComment-1076500 Share on other sites More sharing options...
phpchamps Posted June 24, 2010 Share Posted June 24, 2010 ur wlcme Link to comment https://forums.phpfreaks.com/topic/205720-select-new-inserted-rows-in-database-using-id/#findComment-1076502 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.