Difference between mysql_connect and mysql_pconnect in php?
Answers were Sorted based on User's Feedback
Answer / md amanullah
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 ? | 11 Yes | 1 No |
Answer / aatit
The following are the differences -
- A new connection is established to the database by using
mysql_connect, where as mysql_pconnect opens a persistant
connection to the database.
- mysql_connect can be used to close the connection, where as
mysql_pconnect can not close the connection.
- Database is opened every time when the page is loaded by
mysql_connect. Whereas by using mysql_pconnect, database need
not be connected every time.
| Is This Answer Correct ? | 4 Yes | 0 No |
What is isset in php form?
Is facebook still written in php?
Can php replace javascript?
Is java is better than php?
Does session expire on closing browser?
What type of inheritance that PHP supports?
15 Answers Webwing Technologies,
What is button in html?
Explain PHP looping?
What are the different tables present in mysql, which type of table is generated when we are creating a table in the following syntax: create table employee(eno int(2),ename varchar(10)) ?
What is the use of array_search() in php?
Tell us how to create an array of a group of items inside an html form?
How can we extract string ?allinterview.com ? from a string ?http://info@allinterview.com? using regular expression of PHP?