<分区>
我有一个奇怪的行为。直到今天我使用 -> 从 mysql 结果集中检索成员变量,例如
$username = $result->user_name
但这在我当前的项目中不起作用。
$sth = self::$dbConnection->prepare("SELECT user_id, user_name FROM users");
$sth->execute();
$result = $sth->fetch();
$test = $result->user_password_hash; // $test is null
$test = $result["user_password_hash"]; // this works
????