Your Ad Here
0

What is differenc between mysql_connect and mysql_pconnect?

Posted by The Blogger on 11:44 AM in
Answer:
mysql_pconnect establishes a persistent connection. If you don't need one (such as a website that is mostly HTML files or PHP files that don't call the db) then you don't need to use it. mysql_connect establishes a connection for the duration of the script that access the db. Once the script has finished executing it closes the connection. The only time you need to close the connection manually is if you jump out of the script for any reason.

If you do use mysql_pconnect. You only need to call it once for the session. That's the beauty of it. It will hold open a connection to the db that you can use over and over again simply by calling the resource ID whenever you need to interact with the db.

tags: php interview questions, php interview question What is differenc between mysql_connect and mysql_pconnect, What is differenc between mysql_connect and mysql_pconnect?

0 Comments

Post a Comment

Your Ad Here

Copyright © 2009 Interview Questions and Answers