What is the difference between mysql_connect() and
mysql_pconnect()?
Answers were Sorted based on User's Feedback
Answer / jyotisankar pradhan
mysql_connect open a new connection to the database
but mysql_pconnect open a persistant connection to the database
| Is This Answer Correct ? | 80 Yes | 11 No |
Answer / amita
mysql_connect everytime open a new connection to the database
while using mysql_pconnect , 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...
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.
| Is This Answer Correct ? | 72 Yes | 4 No |
Answer / jayapirakash
Mysql_connect()->we can colse the datedase
Mysql_pconnect()->we can't close the datadase
Mysql_conect()->opens the database every time page is load
Mysql_pconnect()->Need not to the every time page load
| Is This Answer Correct ? | 48 Yes | 11 No |
Answer / nishant patel
mysql_pconnect uses less resources, because it does not need
to establish a database connection every time a page is loaded.
persistant = continuously
| Is This Answer Correct ? | 14 Yes | 1 No |
Answer / pramod kumar
1. mysql_pconnect() creates the persistent connection,mysql_connect not create persistent connection to the database.
2. mysql_connect() connection automatically disconnected after execute the code but mysql_pconnect() not.
| Is This Answer Correct ? | 8 Yes | 2 No |
Answer / sumit
In mysql_pconnect(), ‘p’ stands for persistance connection.
when connecting, the function would try to find a (persistent) connection 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.
mysql_connect() function, every time it is opening and closing the database connection.
| Is This Answer Correct ? | 5 Yes | 1 No |
How many ways to get the current time?
What is the current root password of mysql?
What is the difference between truncate and delete in mysql?
What is MySQL Stored Procedure?
What is blob datatype in mysql?
How do we use % when performing a search query?
What is index length in mysql?
What are the security alerts while using mysql?
What is the innodb in mysql?
How can you count the total number of records of any table?
What are the differences between char and varchar data types?
Explain the difference between mysql_fetch_array(), mysql_fetch_object()?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)