asimryu

delete.php

Aug 23rd, 2017
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. <?php
  2. include("dbcon.php");
  3. $id = 0;
  4. $count = 0;
  5. if( isset($_POST['id']) )
  6. $id = (int)$_POST['id'];
  7. if( $id ) {
  8. $sql = "delete from posts where id={$id}";
  9. if( $rs = $db->query($sql) ) {
  10. $count = $rs->rowCount();
  11. }
  12. }
  13. echo $count;
Add Comment
Please, Sign In to add comment