AdRock Posted March 28, 2008 Share Posted March 28, 2008 How do you get the last record that is in a database? I have a script that I want to run after the database has had a record inserted so I want to check to make sure that record is there Link to comment https://forums.phpfreaks.com/topic/98368-get-last-row-from-database/ Share on other sites More sharing options...
redarrow Posted March 28, 2008 Share Posted March 28, 2008 mysql_affected_rows() mysql function... http://dev.mysql.com/doc/refman/5.0/en/mysql-affected-rows.html or last_insert_id() mysql function look them up please..... mysql functions http://dev.mysql.com/doc/refman/5.0/en/information-functions.html Link to comment https://forums.phpfreaks.com/topic/98368-get-last-row-from-database/#findComment-503393 Share on other sites More sharing options...
sasa Posted March 28, 2008 Share Posted March 28, 2008 SELECT * FROM table ORDER BY id DESC LIMIT 1 Link to comment https://forums.phpfreaks.com/topic/98368-get-last-row-from-database/#findComment-503396 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.