我正在使用此代码在数据库中提取申请人的状态,以便他们在登录时根据用户 ID 显示他们的状态,但我收到以下错误:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in
Warning: mysql_free_result() expects parameter 1 to be resource, boolean given in
$result = mysql_query("SELECT status from users where user_id = ".intval($_SESSION['user_id']));
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
printf("status: %s ", $row[0]);
}
mysql_free_result($result);
echo $row['status'];
提前致谢