$db = new ezSQL_mysql($user,$pass,$db,$server);
$user = $db->get_row("SELECT id,last FROM users WHERE email='$email'");
var_dump($user);
转储返回:
object(stdClass)#11 (5) {
["id"]=>
string(1) "4"
["last"]=>
string(19) "2013-01-06 14:48:24"
}
但是,在尝试通过对象询问用户的id时:
$uid=$user->id;
我收到此错误:
Cannot use object of type stdClass as array
答案 0 :(得分:0)
我通过找到类并推送get_object_vars修复了我自己的问题:
if ( $output == OBJECT )
{
$out = $this->last_result[$y]?$this->last_result[$y]:null;
return get_object_vars($out);
}