emehrkay Posted February 15, 2007 Share Posted February 15, 2007 storing it in a session just doesnt work, any other ideas? Link to comment https://forums.phpfreaks.com/topic/38694-is-there-a-way-to-globally-hold-an-instance-of-a-class/ Share on other sites More sharing options...
trq Posted February 15, 2007 Share Posted February 15, 2007 storing it in a session just doesn't work Um... yes it does. The only other option would be to serialize it and stor eit in a db or something. Link to comment https://forums.phpfreaks.com/topic/38694-is-there-a-way-to-globally-hold-an-instance-of-a-class/#findComment-185853 Share on other sites More sharing options...
emehrkay Posted February 15, 2007 Author Share Posted February 15, 2007 i tried it and i get some crazy error when i try to use it or some of it's methods. something to do with the name of the class. Fatal error: userSQL::login() [<a href='function.userSQL-login'>function.userSQL-login[/url]]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "dbObject" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /homepages/sql.php on line 27 Link to comment https://forums.phpfreaks.com/topic/38694-is-there-a-way-to-globally-hold-an-instance-of-a-class/#findComment-185868 Share on other sites More sharing options...
emehrkay Posted February 16, 2007 Author Share Posted February 16, 2007 i have it working with sessions. you have to include the file before you do session_start(). kinda strange to me, but it works. thanks Link to comment https://forums.phpfreaks.com/topic/38694-is-there-a-way-to-globally-hold-an-instance-of-a-class/#findComment-185927 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.