vendredi 11 septembre 2020

PHP / MySql : Show image A if field is NULL or 0, show image B if field is 1

I have a php table showing tick and cross images based on 0 or 1 in a mysql table but the cross will not show the cross image if the value in the table is 'null' Help please:

echo "<td>";
                                         
if($row['basic_site_induction']=="0")
{
echo '<img src="crosssm.jpg">';
}

else if 
($row['basic_site_induction']=="NULL")
{
echo '<img src="crosssm.jpg">';
}

else
{
echo '<img src="ticksm.jpg">';
}
                                     
echo "</td>";

Aucun commentaire:

Enregistrer un commentaire