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
Where are sessions stored php?
Tell me what is htaccess?
What is action hooks and filter hooks?
Tell me what is the difference between ereg_replace() and eregi_replace()?
Do you know what are traits?
Why json is used in php?
What is in a cookie?
What is cookies? How to create cookies in php?
How do you define a constant?
How can I learn php fast?
Where do we use get and post?
How many days will it take to learn php?
What is strcmp?
What is the best php framework 2018?
Tell me whether it is possible to share a single instance of a memcache between multiple php projects?