Re: Catchable fatal error: Object of class stdClass could not be converted to string in <filename> on line <line>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi 
Seeing as no-one else has replied to this, I'll make a comment.  First
off let me state I don't use PDO so I am not familiar with it.

It would appear to me that your "problem" line is NOT the problem. It is
only where the error is reported from.  That line is a call to an object
method, so the problem is in that method. As you haven't supplied the
code for that method, no one is able to help.

> A point of note is that my $dbh is being created in my class constructor
> as a private. The method that is calling the prepare and execute
> statements is a public. I don't thing I'm trying to do anything new or
> exotic, I don't think I'm trying to convert the object to a string, just
> execute the query statement....

Probably not relevant, although it likely would be better to assign by
reference.

$prep_users =& $this->dbh->prepare($sql_users);

The main problem is we don't know what your $dbh is. We can guess it's a
database handle, but that really doesn't tell us anything useful, like
how it is constructed, and what the method  you try calling is trying to
do

We need to see the code for the method:

$prep_users->execute();

as that is where the error is occurring, and possibly the constructor and
prepare methods also.


Niel

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux