运行此代码时出现两个错误:
<?php
include('config.php');
session_start();
$user_check=$_SESSION['login_user'];
$ses_sql=mysql_query("select username from admin where username='$user_check' ");
$row=mysql_fetch_array($ses_sql);
$login_session=$row['username'];
if(!isset($login_session))
{
header("Location: login.php");
}
?>
代码按我想要的方式执行,但抛出了这两个错误:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/jblanksb/public_html/lock.php on line 9
和
Warning: Cannot modify header information - headers already sent by (output started at /home/jblanksb/public_html/lock.php:9) in /home/jblanksb/public_html/lock.php on line 15
当我尝试使用error_reporting(0);
代码隐藏错误时不起作用。