Advertisement
Guest User

Untitled

a guest
Apr 19th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. $commentDeleteResultSet=[];
  2. $row_id=filter_var($_POST['idRecord'],FILTER_SANITIZE_NUMBER_INT);
  3. $deleteCommentQuery = $db_con->prepare("DELETE FROM tbl_comment WHERE user_id=:usr_id AND row_id=:idRecord");
  4. $deleteCommentQuery->bindParam(":usr_id",$user_id);
  5. $deleteCommentQuery->bindParam(":idRecord",$row_id);
  6. $deleteCommentQuery->execute();
  7. if($deleteCommentQuery->rowCount()>0){
  8. $commentDeleteResultSet['success']=false;
  9. $commentDeleteResultSet['error_msg']="cancellazione commento fallita";
  10. echo json_encode($commentDeleteResultSet);
  11. exit;
  12. }else{
  13. $commentDeleteResultSet['success']=true;
  14. $commentDeleteResultSet['success_msg']="cancellazione commento riuscita";
  15. var_dump($deleteCommentQuery->rowCount());
  16. echo json_encode($commentDeleteResultSet);
  17. exit;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement