所以,这是我的代码:
$query = "SELECT `id` FROM `users` WHERE `username`='$username' AND `password`='$password_hash'";
echo $query;
echo mysql_result(mysql_query($query), 0);
当我在 PHP 中运行此代码时,我执行了查询,并在 phpMyAdmin 中运行它,它显示 id 1。但它不输出任何内容,当运行完整代码时,我收到此错误:
Warning: mysql_result() expects parameter 1 to be resource