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
What is the difference between php and core php?
What is echo in html?
What is the difference between require_once and require in php?
Is json a string php?
What do you use php for?
What is basename php?
Why use static methods php?
What is php sequence?
Which MySQL function would you use to select a database?
When is a conditional statement ended with endif?
How long is csrf token?
What is the static variable in function useful for?
What is rtrim php?
Which php function will attach one file to another?
How to convert strings to upper or lower cases?