Jump to content

mysql_insert_id() or last_insert_id() ?


digitalgod

Recommended Posts

Which one should I use?

I have a query that inserts some info into a table named nights, when that query is done I have another one that inserts info into a table named rTables, in rTables I also have to insert the id  of the last inserted row. If i I use mysql_insert_id() it might give me the id of another table if someone else is doing something on the site.

I was wondering if LAST_INSERT_ID() does the same thing.. and what would be the best way of getting the id of the last row added in a table
Link to comment
https://forums.phpfreaks.com/topic/23906-mysql_insert_id-or-last_insert_id/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.