I am running a check from my Db to see if a grade exists, if it does then spit out the grade inside a link.
If not then spit out another link.
The bit that includes the grade where a grade exists works a treat, it just does not like it if the variable is NULL.
Any ideas to sort this will be much appreciated!
here is what is returned:
the row where no grade appears needs to show the link: <a href="submit/grade.php?id='.$subID.'">G</a>
So:
//run query
$isGrade = "SELECT
gradeID, grade
FROM
Grade
WHERE
assignID = '$assignID'
AND
subID = '$subID'
AND
uNo = '$uNo'
";
$g = mysql_query($isGrade) or die(mysql_error());
while($row=mysql_fetch_assoc($g)){
$gradeID = $row['gradeID'];
$grade = $row['grade'];
if ($gradeID === NULL) {
echo '<td><a href="submit/grade.php?id='.$subID.'">G</a></td>';
}else if ($gradeID != NULL){
echo '<td><a href="submit/grade.php?id='.$subID.'">'.$grade.'</a></td>';
}
echo '</tr>';
}