Re: Re: mysql_insert_id?
| From: | DL Neil | Date: | Wed, 16 Jan 2002 15:42:53 +0000 |
| Subject: | Re: Re: mysql_insert_id? | ||
| References: | 1 2 3 | Groups: | php.db php.general |
| Request: | Send a blank email to php-general+get-80732@lists.php.net to get a copy of this message | ||
Hi Martin,
> > 2 because the (function argument) controlling feature is the connection, it is not
> > possible for another
> > concurrent user to 'steal' your ID or influence the ID returned to you -
> > it's all yours!
>
> Ok, assume you are correct, but what if you are using persistent
> connections (ie pconnet)?
=According to the manual (Chapter 22. Persistent Database Connections) there is no difference in
"functionality"
between persistent and non-persistent connections (only a (possible) difference in
efficiency/response time).
Thus use of persistence does not buy you into other issues.
=If I leave it there, you're going to come back with another question, aren't you!?
=This is my understanding. A connection is set up to enable communication between the PHP script and
the RDBMS.
The connection is exclusive to the script and only lasts the life of the script. Now let's look
at the word
"script". Each user/browser is processed within the (Apache) web server as a separate
child process. If the
process calls for PHP processing, then what happens in one process within the web server is kept
quite separate
from what's happening in another process. This applies even if they both use PHP, and even if
they are both
running the same PHP script, and even against the same MySQL db/tbl, ie because of the way Apache
works, there
is no 'sharing' of connections/cleverness in a bid for extra 'efficiency'.
=Thus there is no way for my (connection) use of the db to interfere with your (separate connection)
use of the
same, in terms of AUTO_INCREMENT, INSERT IDs, and suchlike.
=I'd really like to hear from someone who can talk more authoritatively on the subject though!
=Regards,
=dn