TIA,
What you described is not possible. When you create that connection to the
mysql server, that connection dies when the script ends...

As far as persistent connections go, you will always call the code to create
the connection, but that connection lives on in that apache child process
until that child process dies.

So for example, apache spawns a child process to handle a request and it
executes your PHP script with the persistent connection code
(mysql_pconnect) and then after you script exits, that child process keeps
the conection to mysql open. Any PHP script afterwards that uses the same
connection information (host, username, password) with the mysql_pconnect()
call; apache checks for an existing persistent connection (that was created
with the first PHP script execution) so it returns that connection id. If
you use the standard mysql_connect call the apache child will drop the
connection when the script ends.

Cheers,
-Jonathan Sharp
js_AT_imprev.com

> -----Original Message-----
> From: andrie [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 23, 2001 3:38 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: [PHP] connection id
>
>
> Hello php mania,
>   i was connecting into mysql using mysql_connect, and i just saved
>   the return value from this funtion. now i want to use this connection
>   id in the other page so i dont have to connect into mysql again.
>   is it possible for me to do that ?
>   anybody could tell me the different between persistence connection
>   or not ? and how the implementation ?
>
>   TIA
>
>
> --
> Best regards,
>  andrie                          mailto:[EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to