Ignoring empty mysql fields.
I have a database of 5 questions but for some entries maybe only 2 or 3 of the questions fields are filled in.
I am trying to build a table using the results and i am trying to exclude the empty fields with an if statement but if seems to be ignoring all fields now, even those filled in.
Can anyone help? Here's my code...
I have a database of 5 questions but for some entries maybe only 2 or 3 of the questions fields are filled in.
I am trying to build a table using the results and i am trying to exclude the empty fields with an if statement but if seems to be ignoring all fields now, even those filled in.
Can anyone help? Here's my code...
Code:
if (!$row["t_bonus1_qu"] == void) {
echo '
<tr class="trump_rowB">
<td>'.$row["t_bonus1_qu"].'</td>
<td>'.$row["t_bonus1_sc"].'</td>
</tr> ';
}
if (!$row["t_bonus2_qu"] === "") {
echo '
<tr class="trump_rowA">
<td>'.$row["t_bonus2_qu"].'</td>
<td>'.$row["t_bonus2_sc"].'</td>
</tr> ';
etc...
}