Hi
Let us say you have a website where you, in a lot of different classes, connect to your database to
retrieve/update information.
Should you then use mysql_connect or mysql_pconnect?
Or should you only once (for instance in "index.php"), create the connection, and then pass that link
to all classes that need to work with the database?
What are the advantages and disadvantages using mysql_connect, mysql_pconnect?
Use mysql_connect or mysql_pconnect?
Moderator: General Moderators
-
PhpMachine
- Forum Commoner
- Posts: 42
- Joined: Thu Apr 19, 2007 11:26 am
Persistent connections will persist until you explicitly close them. In my opinion, not good for high traffic web sites or sites with lots of readable content. (why would you want your database connection open for X minutes while user is reading)
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
-
PhpMachine
- Forum Commoner
- Posts: 42
- Joined: Thu Apr 19, 2007 11:26 am