|
INTERVIEW QUESTIONS
PROGRAMMING LANGUAGES
PHP
DETAILS
Question: Difference between mysql_connect and mysql_pconnect in PHP?
Answer: There is a good page in the php manual on the subject, in short mysql_pconnect() makes a persistent connection to the database which means a SQL link that do not close when the execution of your script ends. mysql_connect()provides only for the database new connection 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.
|
|
|
Category |
PHP Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 6979 users |
Added on |
8/27/2016 |
Views |
70068 |
Rate it! |
|
|
Question:
Difference between mysql_connect and mysql_pconnect in PHP?
Answer:
There is a good page in the php manual on the subject, in short mysql_pconnect() makes a persistent connection to the database which means a SQL link that do not close when the execution of your script ends. mysql_connect()provides only for the database new connection 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. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
What is the use of "ksort" in PHP?
|
View Answer
|
|
What is the difference between $var and $$var?
|
View Answer
|
|
What are the encryption techniques in PHP?
|
View Answer
|
|
What htmlentities() does in PHP?
|
View Answer
|
|
How to delete a file from the system in PHP?
|
View Answer
|
|
How to get the value of Current Session Id in PHP?
|
View Answer
|
|
What are the different types of errors in PHP ?
|
View Answer
|
|
What is SQL Injection ?
|
View Answer
|
|
What is x+ mode in fopen() used for, in case of PHP?
|
View Answer
|
|
What is PEAR in case of PHP?
|
View Answer
|
|
Distinguish between urlencode and urldecode in PHP?
|
View Answer
|
|
What are different types of Runtime Errors in PHP?
|
View Answer
|
|
What are the different validators in ASP.NET?
|
View Answer
|
|
How to execute an sql query? How to fetch its result ?
|
View Answer
|
|
What is the difference between Session and Cookie?
|
View Answer
|
|
What are different types of Runtime Errors in PHP?
|
View Answer
|
|
Explain the "unlink" and "unset" functions.
|
View Answer
|
|
How can we encrypt the password using PHP?
|
View Answer
|
|
What does PEAR stands for?
|
View Answer
|
|
How can PHP and Javascript interact?
|
View Answer
|