I have quiz ID(Q1 for example) and below is the number of items in that quiz. My problem is, I need to display a dash when query cannot find a record in my database, if there is a record it will show up and the missing records will be filled with "-". By the way, "a" in the scores is unnecessary. Responses will be much appreciated, thanks in advance!
$sql3 = "SELECT score FROM quiz_score_tbl WHERE username = '$stud_no'";
$result3 = mysql_query($sql3);
$checker3 = mysql_num_rows($result3);
while($row3 = mysql_fetch_array($result3))
{
$score = $row3['score'];
echo"<td> $score a</td>";
if ($score == "" OR $score == NULL OR $checker3 == 0)
{
echo"<td>-</td>";
}
}