Christian Hilberink Christian Hilberink - 1 month ago 18
MySQL Question

If statements not working for Status Check

Hello People of stack overflow,

I have tried many things to fix this code but it doesnt show anything on my page the msqli is included so thats not the problem it is for a Status check like 'Accepted, in-hold, declined' i really dont know what the problem is and i found nothing on google can someone please help me?

if($row['status'] === '1'){
echo "<div class='accepted'>Geaccepteerd</div>";
} elseif($row['status'] === '0'){
echo "<div class='inhold'>Wachten op goedkeuring</div>";
} elseif($row['status'] === '2'){
echo "<div class="declined">Afgekeurd</div>";
} else { echo"<div class='ndefined'>Onbekend</div>"; }


the $row['status'] shows 2 when i echo it but it doesnt work when i get it trought this code

Answer
if($row['status']=="1"){
   echo '<div class="accepted">Geaccepteerd</div>';
}

elseif($row['status']=="0") {
  echo '<div class="inhold">Wachten op goedkeuring</div>';
}

elseif($row['status']=="2"){
  echo '<div class="declined">Afgekeurd</div>';
}

else { 
  echo '<div class="ndefined">Onbekend</div>';
}