★ wanayoo — archive 1999 http://www.devshed.com/Talk/Forums/Forum4/HTML/000822.htmlNouvelle recherche | Portail wanayoo
DevShed Menu
* DevShed Home
* Developer News
* DevShed Brain Dump




UBBFriend: Email This Page to Someone!
  DevShed Discussion Forums
  MySQL
  mysql_pconnect vs mysql_connect

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   mysql_pconnect vs mysql_connect
joce
Junior Member
posted August 09, 2000 04:46 AM     Click Here to See the Profile for joce   Click Here to Email joce     Edit/Delete Message Reply w/Quote
What is the pro of opening a mysql_pconnect instead of a mysql_connect (speed ?)

rod k
Member
posted August 09, 2000 06:06 AM     Click Here to See the Profile for rod k   Click Here to Email rod k     Edit/Delete Message Reply w/Quote
Yes. pconnect uses an existing connection between the php module and mysql (if there is one). However, connections do not remain persistent unless php is a module.

joce
Junior Member
posted August 09, 2000 06:12 AM     Click Here to See the Profile for joce   Click Here to Email joce     Edit/Delete Message Reply w/Quote
But when should I close the database connection, if I don't close it at the end of the php script ?
And if the database is already open what is the effect of a second mysql_pconnect ?

Thank you

rod k
Member
posted August 09, 2000 08:10 AM     Click Here to See the Profile for rod k   Click Here to Email rod k     Edit/Delete Message Reply w/Quote
You don't need to worry about closing the connection. If you use mysql_connect() it will automatically close when the script exits. If you use mysql_pconnect() any mysql_close() you use will be ignored.

If a connection already exits, the link id of the current connection will be returned.

All times are MST (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | DevShed.com

Copyright © 1997-2000 ngenuity. All rights reserved.

Powered by: Ultimate Bulletin Board, Version 5.41a
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 1999.