Catchablefatalerror: ObjectofclassdUsercouldnotbeconvertedtostringinonline16 when getUserByName is run, the message Catchablefata Catchable fatal error: Object of class dUser cocould not be converted to string in on line 16 is displayed.
When getUserByName is run, the following error occurs: Catchable fatal error: Object of class dUser cocould not be converted to string in on line 16. I don't know where the problem is. Please help us. Thank you !!!
PHP code
true)); return $pdo; } public function getUserByName(&$info, $name) { $dbpdo = $this->newpdo(); $sql = "SELECT * FROM `usermember` WHERE `user`=?"; $st = $dbpdo->prepare('SELECT * FROM `usermember` WHERE `user`=?'); $bRet = $st->execute(array($name)); $info = $st->fetch(PDO::FETCH_ASSOC); return $bRet; }}?>
------ Solution --------------------
The $ name parameter is included in a class dUser variable.