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 get and post in php?
Explain PHP looping?
What are php data types?
What is php explain?
What is php glob?
When a conditional statement is ended with an endif?
What are the method available in form submitting?
Explain the difference b/w static and dynamic websites?
Explain how can we execute a php script using command line?
What is the major php security hole? How to avoid?
What is difference between strstr() and stristr()?
Which is better php praogramming or cad/cam scope wise and also salaray wise?
Why do we use php?
What is meant by session in php?
How to receive a cookie from the browser?