Advertisement
Guest User

Untitled

a guest
Oct 16th, 2015
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <?php
  2. //call the connection file
  3. require 'connessione.php';
  4. //errors enabled
  5. error_reporting(-1);
  6. ini_set('display_errors', 'On');
  7. var_dump($_POST);
  8. $myId = intval($_POST['idRecord']);
  9. try {
  10. $dbh = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
  11. // set the PDO error mode to exception
  12. $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  13. $del = $dbh->prepare("DELETE FROM tagesroma WHERE id= '" . $myId . "'");
  14. $del->execute();
  15. $count = $del->rowCount();
  16. echo json_encode($count);
  17. }
  18. catch(PDOException $e)
  19. {
  20. echo "Connection failed: " . $e->getMessage();
  21. }
  22. $dbh = null;
  23. var_dump($count);
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement