faqts : Computers : Programming : Languages : PHP : Database Backed Sites : MySQL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

19 of 111 people (17%) answered Yes
Recently 9 of 10 people (90%) answered Yes

Entry

Can I rely on mysql_insert_id when using persistent database connections?
Are there any problems to be aware of when coding for persistent database connections?
Do I need to treat persistent database connections differently?

Jul 2nd, 1999 00:03
Nathan Wallace, Mattias Nilsson


Persistent database connections are allocated to a httpd child process. 
They are not shared between processes.  So you are guarenteed that a
single database connection will only be used by a single executing
script at any time.  Of course, the same process and connection may be
used by a number of scripts one after the other.

This means that you can always rely on the results of functions like
mysql_insert_id().

Basically there is absolutely no difference in PHP between the use of
database connections and persistent database connections.