mysql_connect or mysql_pconnect?
Posted: Wed Jul 03, 2002 4:16 pm
Hi
I am learning MySQL transaction with PHP. I understand that there are two ways to make a connection with MySQL. One of them is using mysql_connect, and the other is mysql_pconnect.
In PHP manual, and in every books that I reviewed, they said when I use musql_pconnect, a persistent connection will be established, and when the execute of script ends, it remains for future use. I can't close the connection by mysql_close function, too.
My question is here: Does this matter a risk for my data security? When I establish a persistent connection, it still open after my script end, so can others access to my database? I know there is a limitation for active connections in MySQL and Apache systems (I think it is about 100 connections), so it is better to use a persistent connection. But is there any security to protect my data from others?
How can I close a persistent connection?
Thanks
I am learning MySQL transaction with PHP. I understand that there are two ways to make a connection with MySQL. One of them is using mysql_connect, and the other is mysql_pconnect.
In PHP manual, and in every books that I reviewed, they said when I use musql_pconnect, a persistent connection will be established, and when the execute of script ends, it remains for future use. I can't close the connection by mysql_close function, too.
My question is here: Does this matter a risk for my data security? When I establish a persistent connection, it still open after my script end, so can others access to my database? I know there is a limitation for active connections in MySQL and Apache systems (I think it is about 100 connections), so it is better to use a persistent connection. But is there any security to protect my data from others?
How can I close a persistent connection?
Thanks