Possible Duplicate:
mysql_fetch_array() expects parameter 1 to be resource, boolean given in select
I get two errors when running this code:
<?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");
}
?>
The code executes how I want it to but throws up these two errors:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/jblanksb/public_html/lock.php on line 9
and
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
When I try and hide the errors with error_reporting(0); the code doesn't work.