mysql_pconnect() will maintain a persistent connection to the database. Whenever your script calls the connect to database function, it first searches already existing connections to the database and if exists it will use the same connection to connect to the database, if not it will open a new connection to the database. ie. Connection is Persistent

where as mysql_connect() function will establish a new connection whenever a connection to database needed, and after executing the script, this function disconnects the connection. ie. connection is not a persistent one.

mysql_pconnect() function is used where your site has a Heavy Traffic and where as mysql_connect() function is used when there is moderate/less traffic to your site.

Regard’s

Alex P

System Administrator.

This entry was posted on Saturday, June 2nd, 2007 at 10:20 pm and is filed under MySql. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Trackback/Ping

  1. Red    Jun 20 2007 / 10pm:

    Red…

    OMG! I cant beleive it….

Leave a reply

Name (*)
Mail (will not be published) (*)
URI
Comment