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 long do php sessions last?
What's the best method for sanitizing user input with php?
Is it difficult to learn php?
How to get the http request in php?
Is php an array?
Could we start a variable with number like $4name?
How to write a program to make chess?
What is php's mysqli extension?
How to remove duplicate values from array using php?
Does php have a future?
What is php variable?
Explain the difference between php4 and php5.
What is member function?
What is list function with their uses.
Which function is used in php to count the total number of rows returned by any query?