Posted By

daveismyname on 09/27/09



Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


snippet to delete a row from a mysql database

 / Published in: PHP

Delete row from a database bases on a given id

  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  

You need to login to post a comment.