What is the difference between mysql_connect and
mysql_pconnect ? Which one is good in terms of performance ?
Answers were Sorted based on User's Feedback
Answer / brijendra
mysql_connect opens a normal connections to mysql database.
mysql_pconnect opens a persistant connection i.e. if there
is any connection open in the script it will use that
connection not making a new connection each time.
at very high traffic enviornment mysql_connect provides
better performance
| Is This Answer Correct ? | 38 Yes | 3 No |
Answer / ranjan goyal
In addition to what Brijendra said, persistanty connections
are limited per server so limited number of people will
have access to the website so infact it will stop high
traffic that implies if we say assuem that our site will
have high traffic then we must not use persistent
connections. Persistent connections should be used only
where we only have limited number of users
| Is This Answer Correct ? | 21 Yes | 3 No |
Answer / modi
mysql_pconnect Open a persistent connection to a MySQL server
First, when connecting, the function would first try to find
a (persistent) link that's already open with the same host,
username and password. If one is found, an identifier for it
will be returned instead of opening a new connection...
Second, the connection to the SQL server will not be closed
when the execution of the script ends. Instead, the link
will remain open for future use (mysql_close() will not
close links established by
| Is This Answer Correct ? | 11 Yes | 1 No |
Answer / 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 |
Can php use gettext?
Name and explain five of the PHP error constants?
How is it possible to know the number of rows returned in the result set?
Is strcmp case sensitive?
How to execute a function in php?
Here in this site i could not find the details for php ZEND certifications or i think u did not post any ? so i need the information about the php certification how to prepare and some of the mock exams?
can you give me an example code of calling java script function in php variable using AJAX.or with out ajax??????
hai, friend i srinu i had completed my graduation in 2004. now i am fineshed PHP course .may i get any oppartunity on php progr pls sugg me . thank u
sort term descripttion form, report and uery
Tell me what is the difference between exception::getmessage and exception::getline?
What are different types of errors available in Php?
What are the different errors in php?