What is the difference between mysql_connect and
mysql_pconnect ? Which one is good in terms of performance ?
Answer Posted / amit
The mysql_pconnect() function opens a persistent MySQL
connection.
This function returns the connection on success, or FALSE
and an error on failure. You can hide the error output by
adding an '@' in front of the function name.
mysql_pconnect() is much like mysql_connect(), but with two
major differences:
•This function will try to find a connection that's already
open, with the same host, username and password. If one is
found, this will be returned instead of opening a new
connection
•The connection will not be closed when the execution of
the script ends (mysql_close() will not close connection
opened by mysql_pconnect()). It will stay open for future
use
| Is This Answer Correct ? | 7 Yes | 2 No |
Post New Answer View All Answers
How to read and display a HTML source from the website url?
Suppose the variable $var1 is set to 10 and the $var2 is set to the character var1, what's the value of $$var2?
Is it possible multiple inheritance in php?
What does PEAR stands for?
What is the difference between php and core php?
Is null empty php?
How to convert strings in hex format?
What is the functionality of md5 function in php?
Can we override static method in php?
What is the difference between for and foreach in php?
What is difference between post and put in rest?
What is static in php?
Explain Constant in Class?
Explain the differences between get and post methods?
How to define a user function?