this problem is described in a lot of forums and other articels
on the net already but I still cant make it work:
I am trying to put a class into a session so that I dont have to
include it again and again (it's a DB Access Class).
Here is what I do on page one:
<? include('database.php'); session_start(); header("Cache-control: private"); //IE 6 Fix $_SESSION ['database'] = new database; $database = &New database; $query="SELECT name FROM users where id = 63"; $database->setQuery($query); $row=$database->loadObjectList(); $row=$row; ?> <a href ="http://testserver/test/test2.php">Show <? echo $row->name;?>'s username</a>
-> this works fine and the result is delivered from the DB.
The link in there brings me to the next page which looks like this:
<? session_start(); header("Cache-control: private"); //IE 6 Fix echo "Session: <pre>"; print_r($_SESSION); echo "</pre><br><br>"; $query="SELECT username FROM users where id = 63"; $database->setQuery($query); $row=$database->loadObjectList(); $row=$row; echo $row->username; ?>
As you can see I am looking into the session to see what's in it
but I keep getting:
[database] => __PHP_Incomplete_Class Object.
All the topics I found somewhere else just say that I need to include the class file before
I start the session, but I do that already [img src=\"style_emoticons/[#EMO_DIR#]/huh.gif\" style=\"vertical-align:middle\" emoid=\":huh:\" border=\"0\" alt=\"huh.gif\" /]
I know this is trivial but I just cant get the hang of it.
Your help is highly appreciated.
Thanks & Regards,