Keeping A Mysqli Connection Open
Posted: Sun May 01, 2011 10:04 am
I have a site with a control panel for users that have logged in, While logged in they will be doing a lot of actions that require a database connection which I am using pdo class with mysqli. The site is a single page site but the user could be on for over an hour for which the connection will have to remain open, the user might leave the computer for an hour and providing he hasn't logged out or closed the page the connection still needs to be open.
So is there a way to do this, I don't know how and when the connection will close automatically. I did some research and found that if i use a persistent connection it should stay open until I run the code to close it. Is this true, is there really no time limit on it? Can anyone think of another better way to do this?
Thanks For Your Time
Chris
So is there a way to do this, I don't know how and when the connection will close automatically. I did some research and found that if i use a persistent connection it should stay open until I run the code to close it. Is this true, is there really no time limit on it? Can anyone think of another better way to do this?
Thanks For Your Time
Chris