What is the advantge and disadvantage of mysql_connet() and
mysql_pconnect() ? in which condition will you use
mysql_connect() and mysql_pconnect().
Answer Posted / praveen
mysql_pconnect() will maintain a persistent connection to
the database. whenever your script calls the connect to
database function, it first searches already existing
connections to the database and if exists it will use the
same connection to connect to the database, if not it will
open a new connection to the database. ie. Connection is
Persistent
where as mysql_connect() function will establish a new
connection whenever a connection to database needed, and
after executing the script, this function disconnects the
connection. ie. connection is not a persistent one.
mysql_pconnect() function is used where your site has a
Heavy Traffic and where as mysql_connect() function is used
when there is moderate/less traffic to your site.
| Is This Answer Correct ? | 10 Yes | 1 No |
Post New Answer View All Answers
What is the current stable version of php? What advance thing in php7?
Explain PHP looping?
What is default session time in php?
How do I display php errors?
What are the uses of php language?
Explain what are the three classes of errors that can occur in php?
How the result set of mysql be handled in php?
Why ide is recommended for use while programming with php?
Why do we need session?
What is compact function php?
Is php better than python?
What is lazy loading in php?
What backslash character will match whitespace?
What is difference between ksort() and usort() functions.
What is delimiter php?