Delete data from database by ID : Database Delete « MySQL Database « PHP






Delete data from database by ID



<html>
<body>
<?php
$cnx = mysql_connect('mysql153.secureserver.net','java2s','password');
mysql_select_db('java2s');

$id = '1';
$ok1 = @mysql_query("DELETE FROM Employee WHERE ID='$id'");
if ($ok1) {
  echo('<p>Author deleted successfully!</p>');
} else {
  echo('<p>Error deleting author from database!<br />'.
       'Error: ' . mysql_error() . '</p>');
}

?>
</body>
</html>


           
       








Related examples in the same category

1.Delete data from database table