Re: [PHP-DB] losing MySQL resource

2009-11-09 Thread Andy Shellam (Mailing Lists)
Hi Stan, Are you saving the instance of your class in $_SESSION? Class instances can be persisted across sessions, however resources (i.e. MySQL and other DB connections) cannot. What you need to do, is every method in your wrapper class that uses the MySQL resource needs to check if it's

Re: [PHP-DB] losing MySQL resource

2009-11-09 Thread Stan
I got as far as creating a class to be the wrapper ... instantiating an object of that class ... saving the reference in a $_SESSION variable ... but my object reference seems to be invalid upon the next request (in the same session) from the client browser. What have I missed? Thanks, Stan ""An

Re: [PHP-DB] losing MySQL resource

2009-11-09 Thread Andy Shellam (Mailing Lists)
Hi, I got around this by creating a database wrapper class which gets passed the credentials from the app's config file. An instance of the class is created and saved in the session, and every query to the database runs through the class's Query() wrapper method which checks if the conne

Re: [PHP-DB] losing MySQL resource

2009-11-09 Thread Stan
How do I make an Object persistant for the duration of a Session? Thanks, "Chris" wrote in message news:4ab6b16...@gmail.com... > Niel Archer wrote: > >> I'm maintaining a session. I successfully connect to a database ($DBConnect > >> = mysql_connect()). I save the connection resource in a sessi