Re: __PHP_Incomplete_Class Errors...
| From: | (PHPDiscuss - PHP Newsgroups and mailing lists) | Date: | Thu, 11 Nov 2004 11:26:46 +0000 |
| Subject: | Re: __PHP_Incomplete_Class Errors... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-201748@lists.php.net to get a copy of this message | ||
Stephen Craton wrote:
> I've been working on a script for a while now and it works perfectly on my
> local machine. I'm using a couple of classes, mainly my database and users
> classes.
> After logging in, I assign a session variable to the user's row in the
> database: $_SESSION['user'] = $db->row;
> This works fine locally, but on my hosted machine, it settings the variable
> to this:
> __PHP_Incomplete_Class Object
> (
> [__PHP_Incomplete_Class_Name] => users
> [user] =>
> [loggedin] => 1
> [ip] => 12.222.81.78
> [db] => __PHP_Incomplete_Class Object
> (
> [__PHP_Incomplete_Class_Name] => thedatabase
> [host] => localhost
> [user] => melchior_clients
> [pass] => ****************
> [data] => melchior_clients
> [linkid] => 0
> [res] => 0
> [num] => 0
> [row] =>
> [logger] => __PHP_Incomplete_Class Object
> (
> [__PHP_Incomplete_Class_Name] => logger
> [logdir] => logs/
> [fp] =>
> )
> )
> [logger] => __PHP_Incomplete_Class Object
> (
> [__PHP_Incomplete_Class_Name] => logger
> [logdir] => logs/
> [fp] =>
> )
> )
> For some reason, as far as I can tell, it's making every class variable to
> __PHP_Incomplete_Class for some reason. The way I'm accessing the classes
> via another class this something like this:
> $db = new theDatabase;
> $user = new Users;
> $user->db = $db;
> And then, within the class, I access it as such:
> $this->db->query($sql);
> This works perfectly on my local machine, but it gets all weirded once I
> upload it. I have NO idea why or how to fix it. Does anyone have any ideas?
> ------------------------------------
> Stephen Craton
> webmaster@melchior.us
> IM: webmaster@melchior.us
> http://www.melchior.us
> ------------------------------------
I had the same problem when storing objects in the session, this link will
tell you
how to solve your problem
http://lists.evolt.org/archive/Week-of-Mon-20031027/150721.html
rgs,
Nick