|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
What is the pro of opening a mysql_pconnect instead of a mysql_connect (speed ?)
|
|
#2
|
|||
|
|||
|
Yes. pconnect uses an existing connection between the php module and mysql (if there is one). However, connections do not remain persistent unless php is a module.
|
|
#3
|
|||
|
|||
|
But when should I close the database connection, if I don't close it at the end of the php script ?
And if the database is already open what is the effect of a second mysql_pconnect ? Thank you ![]() |
|
#4
|
|||
|
|||
|
You don't need to worry about closing the connection. If you use mysql_connect() it will automatically close when the script exits. If you use mysql_pconnect() any mysql_close() you use will be ignored.
If a connection already exits, the link id of the current connection will be returned. |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > mysql_pconnect vs mysql_connect |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|