Question : Using the mysql last_insert_id()

Hi guys.
I have a table which im trying to update a row using the last_insert_id()
I have 60 rows in this table.
When I run
select last_insert_id() from
I get 60 rows back with a value of 0
So when I try and run
update entries_ent set name_ent='dummy update' where id_ent=last_insert_id();
the update fails
Could some nice guru please shed some light on how you get the last_insert_id?
Thanks guys.

Answer : Using the mysql last_insert_id()

last_insert_id() is used right after you inserted a new row and you need to grab the id of that row to perform some other task.

If you need to get the last row that was inserted in the db you can used ORDER BY id DESC this will give you the last row of the table (given that id is an auto-increment field)
Random Solutions  
 
programming4us programming4us