term_post.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. require_once "../path.php";
  3. require_once "../public/_pdo.php";
  4. require_once '../public/function.php';
  5. $respond=array("status"=>0,"message"=>"");
  6. PDO_Connect("sqlite:"._FILE_DB_TERM_);
  7. if($_POST["id"]!=""){
  8. $query="UPDATE term SET meaning= ? ,other_meaning = ? , tag= ? ,channal = ? , language = ? , note = ? , receive_time= ?, modify_time= ? where guid= ? ";
  9. $stmt = @PDO_Execute($query,array($_POST["mean"],
  10. $_POST["mean2"],
  11. $_POST["tag"],
  12. $_POST["channal"],
  13. $_POST["language"],
  14. $_POST["note"],
  15. mTime(),
  16. mTime(),
  17. $_POST["id"]
  18. ));
  19. if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
  20. $error = PDO_ErrorInfo();
  21. $respond['status']=1;
  22. $respond['message']=$error[2].$query;
  23. }
  24. else{
  25. $respond['status']=0;
  26. $respond['message']=$_POST["word"];
  27. }
  28. }
  29. else{
  30. }
  31. echo json_encode($respond, JSON_UNESCAPED_UNICODE);
  32. ?>