collect_get.php 967 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. //查询term字典
  3. require_once "../path.php";
  4. require_once "../public/_pdo.php";
  5. require_once '../public/function.php';
  6. require_once '../ucenter/function.php';
  7. if(isset($_GET["id"])){
  8. PDO_Connect("sqlite:"._FILE_DB_USER_ARTICLE_);
  9. $id=$_GET["id"];
  10. $query = "select * from collect where id = ".$PDO->quote($id);
  11. $Fetch = PDO_FetchRow($query);
  12. if($Fetch){
  13. $userinfo = new UserInfo();
  14. $user = $userinfo->getName($Fetch["owner"]);
  15. $Fetch["username"] = $user;
  16. echo json_encode($Fetch, JSON_UNESCAPED_UNICODE);
  17. exit;
  18. }
  19. }
  20. else if(isset($_GET["article"])){
  21. PDO_Connect("sqlite:"._FILE_DB_USER_ARTICLE_);
  22. $article=$_GET["article"];
  23. $query = "select * from collect where article_list like ".$PDO->quote('%'.$article.'%');
  24. $Fetch = PDO_FetchAll($query);
  25. echo json_encode($Fetch, JSON_UNESCAPED_UNICODE);
  26. exit;
  27. }
  28. echo json_encode(array(), JSON_UNESCAPED_UNICODE);
  29. ?>