Re: MySQL INSERT
| From: | Justin French | Date: | Mon, 19 Nov 2001 04:49:44 +0000 |
| Subject: | Re: MySQL INSERT | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-75068@lists.php.net to get a copy of this message | ||
Thanks David,
I've skipped off to the manual and done a bit of reading, but i'm a
little confused. The user-added notes have actually clouded the issue more!!
It *looks like* from what they're saying, that the number returned may
not be the number that I want, if someone else inserted just after me.
They go to talk about locking and all sorts of junk, but I was hoping
you could clarify the bit about an idenitifier.
How do I specify an identifier upon INSERT, and how do I re-use it when
using mysql_insert_id?
Or is all of this implied by PHP/MySQL?
Many thanks,
Justin French
> mysql_insert_id is your friend, in this case. Even if someone inserts
> another record, this function will return the auto ID for the last insert
> performed using a given link identifier. So you feed it the link
> identifier for _your_ insert, which of course you know, and Bob's yer
> uncle :-)