SearchArea.php 552 B

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