Hi,
I have a site with various parts which allow users to enter info via forms
which gets entered into various tables in a MySQL db (I'm using ASP, rather
than PHP).
I have an ecards bit, and when users send a card, their data is entered into
the db via something like:
INSERT vars into ecard_tbl....
I just read that I can use this to get the most recent id from the
autoincrement field in the table:
SELECT LAST_INSERT_ID
However, it doesn't seem to need a table name for that. What if exactly at
the same time another users enters something into my guestbook. That will
submit data to the same MySQL db, so won't the 'SELECT LAST_INSERT_ID' give
me that ID, and not the ID from the card submission?
Am I missing something very obvious here? I checked the MySQL docs but can't
see anything obvious.
Thanks
Jim
I have a site with various parts which allow users to enter info via forms
which gets entered into various tables in a MySQL db (I'm using ASP, rather
than PHP).
I have an ecards bit, and when users send a card, their data is entered into
the db via something like:
INSERT vars into ecard_tbl....
I just read that I can use this to get the most recent id from the
autoincrement field in the table:
SELECT LAST_INSERT_ID
However, it doesn't seem to need a table name for that. What if exactly at
the same time another users enters something into my guestbook. That will
submit data to the same MySQL db, so won't the 'SELECT LAST_INSERT_ID' give
me that ID, and not the ID from the card submission?
Am I missing something very obvious here? I checked the MySQL docs but can't
see anything obvious.
Thanks
Jim
Comment