How do I use php so it tests if a value in a mysql table is equal to a string? I am making a bans list and theres several categories, mutes, warnings and bans. The problem at the moment is they all display in every category so bans, mutes, warnings display in bans, mutes and warnings. They aren't sorted. I tried to fix it by using
<td><?php if($row['punishmentType'] == 'BAN') { echo "<img src='http://ift.tt/2hKj9V4" . $row['name'] . "/25' style='margin-bottom:5px;margin-right:5px;border-radius:2px;' />" . $row['name']; } else { echo 'ERROR' }?></td>
But it comes up with ERROR. In the mysql table, theres 3 punishment types, BAN, MUTE and WARNING. Can someone tell me whats wrong with the code above? And how I fix it.
Aucun commentaire:
Enregistrer un commentaire