get last mysql row from database retrieve last entry ID from table
RegisterLogin
get last mysql row from database retrieve last entry ID from table
Post Description: get last mysql row from database retrieve last entry ID from table
Tags: get, last, mysql, row, from, database, retrieve, last, entry, ID, from, table
This Post Was Posted On Feb 29, 2008 By web hosting #1247
Post Description: get last mysql row from database retrieve last entry ID from table
Tags: get, last, mysql, row, from, database, retrieve, last, entry, ID, from, table
This Post Was Posted On Feb 29, 2008 By web hosting #1247
get last mysql row from database retrieve last entry ID from table by web hosting
for example, i had a table with user names and each user had a user_id field, this field was incrementing so each user_id was unique. so as new users signed up, a new user_id was created but i wanted a way to get the last user_id for a script i was writing so this is the way i found out on using php to search and getting the id of the last inserted row in mysql through php.
you can use this query to get the results you want with this sql query i created to use as en example:
code:
$sql = "SELECT user_id FROM my_users_table ORDER BY user_id DESC LIMIT 0,1";
this will retrieve the last entry on your database and you can use it or display it on your script.
©2011 Webune Forums - Sat Dec 24, 2011 7:33 pm
Powered by: Webune Forums V3
Powered by: Webune Forums V3