Difference between mysql_connect and mysql_pconnect in php?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I install php and apache on windows 10?

520


Do you know how to get the ip address of the client?

522


How to reset/destroy a cookie?

583


What are php variables?

517


Write a php script to get the largest key in an array?

517






Tell me what does the initials of php stand for?

558


Is php used for frontend or backend?

534


What is difference between array_merge and array_combine?

523


How can we check the value of a given variable is a number?

616


Is python similar to php?

554


What is isset php?

525


What are the functions of string?

530


What is a controller in programming?

499


What is default session time and path in php?

551


Can we use php variable in javascript?

536