historay_get.php 729 B

1234567891011121314151617181920212223
  1. <?php
  2. #句子的历史记录
  3. require_once "../config.php";
  4. require_once "../public/_pdo.php";
  5. require_once "../public/function.php";
  6. require_once "../ucenter/function.php";
  7. $respond['id'] = $_GET["id"];
  8. $respond['status'] = 0;
  9. $respond['error'] = "";
  10. $respond['data'] = array();
  11. PDO_Connect("" . _FILE_DB_USER_SENTENCE_HISTORAY_);
  12. $query = "SELECT sent_id, user_id, text, date, landmark FROM sent_historay WHERE sent_id = ? LIMIT 0,200";
  13. $fetch = PDO_FetchAll($query, array($_GET["id"]));
  14. $_userinfo = new UserInfo();
  15. foreach ($fetch as $key => $value) {
  16. # code...
  17. $fetch[$key]["userinfo"] = $_userinfo->getName($value["user_id"]);
  18. }
  19. $respond['data'] = $fetch;
  20. echo json_encode($respond, JSON_UNESCAPED_UNICODE);