Searchproduct.php 566 B

1234567891011121314151617181920
  1. <?php
  2. include "conn.php";
  3. checkLogin("信息管理");
  4. $str = textEncode($_GET['str'] ?? '');
  5. $sql = "select id,ProductImg,ProductName,unit from Products where productName like '%" . $str . "%'";
  6. $rs = $conn->query($sql);
  7. while ($row = $rs->fetch()) {
  8. ?>
  9. <li data-id="<?php echo $row['id']; ?>" data-unit="<?php echo $row['unit']; ?>">
  10. <div class="list-content">
  11. <div class="pic"><img src="<?php echo $row['ProductImg']; ?>" ></div>
  12. <div class="name"><?php echo $row['ProductName']; ?></div>
  13. </div>
  14. </li>
  15. <?php
  16. }
  17. ?>