snippet to delete a row from a mysql database

/ Published in: PHP
Save to your folder(s)

Delete row from a database bases on a given id

Copy this code and paste it in your HTML
  1. $id = mysql_real_escape_string($_GET['id'];
  2. $sql = mysql_query("DELETE FROM table WHERE id = '$id'");
  3. header('Location: ' . $_SERVER['HTTP_REFERER']);

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.