不确定如何将图像差异添加到HTML表的php/sql填充中 处境

不确定如何将图像差异添加到HTML表的php/sql填充中 处境,php,mysql,Php,Mysql,我目前正在使用PHP填充一个HTML表,使用以下代码工作正常: <?php while ($row = mysqli_fetch_array($result)) { $lineID = $row['lineID']; $ediShipDate = $row['ediShipDate']; $resolution = $row['resolution']; $resolutionComments = $r

我目前正在使用PHP填充一个HTML表,使用以下代码工作正常:

<?php
while ($row = mysqli_fetch_array($result)) {

    $lineID             = $row['lineID'];
    $ediShipDate        = $row['ediShipDate'];
    $resolution         = $row['resolution'];
    $resolutionComments = $row['resolutionComments'];

?>

问题 我试着对每一行都这样做,如果ediShipDate等于一件事,我会在那里放置一个图像(而不是变量中的文本),如果它等于另一件事,则放置一个不同的图像。我在这里尝试使用这个代码:

<td>
          <?= $cost?>
          <value="<?= $cost?>"></td>
<td>
          <?php 
            if ($row['ediShipDate'] = "Before Debit Exp"){
              print("<img src=/img/check-yes.png>");
              print("one") ;
            }
            else if  ($row['ediShipDate'] = "AFTER DEBIT EXP!"){
              print("<img src=/img/check-no.png>");
              print("two") ;
            }
            else {
            print $row['ediShipDate'] ;
            print("three") ;
            }
          ?>
          <value="<?= $ediShipDate ?>"></td>
<td>
              <?= $cost?>
              <value="<?= $cost?>"></td>


在IF语句中,指定的是值,而不是比较

=
=
==

您至少需要将它们切换到
=
,但最好使用
==

          <?php 
            if ($row['ediShipDate'] === "Before Debit Exp"){
              print("<img src=/img/check-yes.png>");
              print("one") ;
            }
            else if  ($row['ediShipDate'] === "AFTER DEBIT EXP!"){
              print("<img src=/img/check-no.png>");
              print("two") ;
            }
            else {
            print $row['ediShipDate'] ;
            print("three") ;
            }
          ?>
          <value="<?= $ediShipDate ?>"></td>