coop_del.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. require_once '../group/function.php';
  8. $respond['status']=0;
  9. $respond['message']="成功";
  10. if(isset($_POST["res_id"])){
  11. PDO_Connect(_FILE_DB_USER_SHARE_);
  12. $query = "DELETE FROM share_cooperator WHERE res_id=? and cooperator_id = ? ";
  13. $sth = $PDO->prepare($query);
  14. if($sth)
  15. {
  16. # code...
  17. $sth->execute(array($_POST["res_id"],
  18. $_POST["user_id"]
  19. ));
  20. if (!$sth || ($sth && $sth->errorCode() != 0)) {
  21. /* 识别错误 */
  22. $error = PDO_ErrorInfo();
  23. $respond['status']=1;
  24. $respond['message']=$error[2];
  25. echo json_encode($respond, JSON_UNESCAPED_UNICODE);
  26. exit;
  27. }
  28. else{
  29. $respond['status']=0;
  30. $respond['message']="成功";
  31. }
  32. }
  33. echo json_encode($respond, JSON_UNESCAPED_UNICODE);
  34. }
  35. else{
  36. $respond['status']=1;
  37. $respond['message']="no res id";
  38. echo json_encode($respond, JSON_UNESCAPED_UNICODE);
  39. }
  40. ?>