暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

getIndexZCGS.php 576B

123456789101112131415161718192021222324252627
  1. <?php
  2. header('Content-type:text/html;charset=utf-8');
  3. $cid = $_GET['cid'];
  4. $link = mysqli_connect('localhost', 'shenzhenmayi', 'w82q5bmy', 'shenzhenmayi');
  5. if(!$link){
  6. exit('数据库连接失败!');
  7. }
  8. $n = 0;
  9. $arr = array();
  10. $sql = "SELECT * FROM ey_archives WHERE typeid = 2 && city_id = $cid LIMIT 5";
  11. $res = mysqli_query($link, $sql);
  12. while($row = mysqli_fetch_array($res)){
  13. $arr[0][$n] = $row['aid'];
  14. $arr[1][$n] = $row['title'];
  15. $arr[2][$n] = date('Y-m-d', $row['add_time']);
  16. $n++;
  17. }
  18. echo json_encode($arr);
  19. mysqli_free_result($res);
  20. mysqli_close($link);
  21. ?>