jeudi 29 août 2019

If elseif .... What am I missing

I want to show a picture depending on the value of a variable i am reading from a sql database. For some reason it shows always the same pic and i dont know why. The values in the datatable are different....

<?php 
if ($Last < $Nr) {
     $position = '<img src="./images/arrowdwn.png" width="15" height="15" />';
   } elseif ($Nr == $Last) {
     $position = '<img src="./images/arrowstay.png" width="15" height="15" />';
   } elseif ($Last > $Nr) {
     $position = '<img src="./images.arrowup.png" width="15" height="15" />';
   } else {
     $position = '<img src="/images/new.png" width="15" height="15" />';
   }
?>

It only shows the first elseif.... The one where $Nr == $Last.....

Aucun commentaire:

Enregistrer un commentaire