This is a very simple issue. I must just be doing something stupid:
This query echos out a row id number:
$query = "SELECT * FROM userpage WHERE uploaderrating = $rating";
$result = mysql_query($query);
$row1= mysql_fetch_array($result);
echo $row1[id];
When I add in an additional condition (even though the condition is DEFINITELY met in the SQL database the the echo does produce anything (i.e. the variable is empty). The failing code is:
$query = "SELECT * FROM userpage WHERE uploaderrating = $rating and reviewer = NULL";
$result = mysql_query($query);
$row1= mysql_fetch_array($result);
echo $row1[id];
You can’t use
You need to use
NULL is an undefined value, so it isn’t equal to anything; so you need to use IS to look for it.