View Single Post
Old 06-27-2008, 03:07 PM   #3 (permalink)
sketchMedia
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

Basically there are some major differences:
  1. mysql_pconnect creates a 'persistent' connection therefore the link to the database is always open, mysql_connect however isnt like that and its links are closed when the script finishes and therefore must be reopened.
  2. mysql_pconnect searches for exisiting persistent connections ans re-uses them if they are found, mysql_connect on the other hand, does not.
  3. Links created with mysql_pconnect cannot be closed with mysql_close
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)

Last edited by sketchMedia : 06-28-2008 at 01:58 PM. Reason: added 'persistent' to clarify my point
sketchMedia is offline  
Reply With Quote
The Following User Says Thank You to sketchMedia For This Useful Post:
codefreek (06-27-2008)