For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > July 2005 > DB connect object in session









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author DB connect object in session
Tom Rogie

2005-07-24, 8:39 pm

Hello,

For a project with lots of database access, I planned to put the
DB:connect object into a session.

I only have one problem: before I start the session, the classes from
the project must be defined _and_ also the DB object must be connected (
DB::connect( $db ) ) else I get PHP incomplete class object errors.
So I cannot check the isset of my $_SESSION["db"] variable before I do
connect to the database... Means that I have to connect to the database
on every click?

Is there a way to keep using the same database object through the session?

Trogie
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com