Difference between mysql_connect and mysql_pconnect in php?
Answers were Sorted based on User's Feedback
Answer / md amanullah
mysql_connect opens a normal connections to mysql database.
mysql_pconnect opens a persistant connection i.e. if there
is any connection open in the script it will use that
connection not making a new connection each time. at very
high traffic enviornment mysql_connect provides better
performance.
| Is This Answer Correct ? | 11 Yes | 1 No |
Answer / aatit
The following are the differences -
- A new connection is established to the database by using
mysql_connect, where as mysql_pconnect opens a persistant
connection to the database.
- mysql_connect can be used to close the connection, where as
mysql_pconnect can not close the connection.
- Database is opened every time when the page is loaded by
mysql_connect. Whereas by using mysql_pconnect, database need
not be connected every time.
| Is This Answer Correct ? | 4 Yes | 0 No |
What is php call function?
How can I retrieve values from one database server and store them in other database server using PHP?
2 Answers DRC Systems, Photon,
How can you access a COM object from a PHP page?
What is php glob?
How can I find the width and height of an image resource?
2 Answers Rushmore Consultancy,
Tell me what does $_env means?
write the prime number of program?in php
What’s the difference between htmlentities() and htmlspecialchars()?
Why php 7 is faster?
How check submit button is clicked in php?
What is var_dump function in php?
How the values are ordered in an array?