如何通过foreach复制if条件?

时间:2015-07-15 09:38:52

标签: php

有没有人知道通过循环复制IF条件?请。我真的需要你的帮助..这是我第一次遇到这样的事情?感谢帮助。

<?php            
  for($x=0; $fetchImageDirectoryRow = mysqli_fetch_assoc($fetchImageDirectory); $x++){
    $directory = $fetchImageDirectoryRow['Image_Path'];
    list($c, $apache24, $htdocs, $sp, $uploadItem, $imageFilename) = explode('/', $directory);
    $uploadItem = $uploadItem."/".$imageFilename; 

    $imageGet = glob($uploadItem);
    foreach($imageGet as $imagePath){
      $attName = uniqid();

      echo '<td>';
      echo "<img src= '".$imagePath."' class='readyToPostImage'/><br><br>";
      echo "<input type='text' placeholder='Enter New Price (eg. 300)' class='newPriceInput'/><br><br>";
      echo "<a class='addMore'>add more photos</a>";
      echo "<input type='file' class='browseCustom' multiple/><br>";
      echo "<input type='submit' name='".$attName."' class='btn btn-success' value='Post to Peónline'/>";
      echo '</td>';

如何复制此IF条件?是否有通过循环复制语句的函数。

      if(isset($_POST[$attName])){
      mysqli_query($connection, "UPDATE collateral c LEFT JOIN loan_assignment a ON (a.item_id = c.item_id) LEFT JOIN pawnshop b ON (a.pawnshop_id = b.pawnshop_id) SET c.post_status = '1' where status_type = 'FORECLOSED' and  b.email_address = '".$login_session."' and image_path = '".$directory."';");
      mysqli_close($connection);
      }
    }
  }

  ?>

0 个答案:

没有答案