|
-
May 13th, 2007, 01:28 PM
#1
Thread Starter
Addicted Member
Connecting to MySQL over multiple pages
I have multiple PHP scripts on my site and they all have separate connections to my MySQL databases. I want an easy way to share the same connection across these scripts without leaving any connections open after the user has left the site.
I was thinking of using a session to carry the connection handle but the problem with this is if the user leaves the site, their database connection will remain open.
I have a high volume of users and can't mess around with leaving MySQL connections open & unused and I also don't want to have them keep opening and closing connections constantly... it's a waste of valuable system resources.
What is a good solution for this?
-
May 13th, 2007, 01:44 PM
#2
Re: Connecting to MySQL over multiple pages
-
May 13th, 2007, 01:51 PM
#3
Thread Starter
Addicted Member
Re: Connecting to MySQL over multiple pages
ok that would work but how will these connections be closed? If I have 100 people using my site at once, all of them using a separate connection, am I going to run into resource issues?
I guess my question is:
What is going to use less system time, opening & closing a new connection in every script, or using a persistent connection for every script but having several open connections that aren't being used?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|