Possible Duplicate:
mysql_fetch_array() expects parameter 1 to be resource, boolean given in select
I'm using this code to pull out the status of an applicant in the database so their status appears when they login, based on the user ID but I am getting the follwing errors:
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'];
Thanks in advance