MySQL Delete

The DELETE statement is used to delete records in a table.

If you want to delete a record from any MySQL table then you can use SQL command DELETE.


DELETE FROM table_name WHERE Clause condition

If WHERE clause is not specified then all the records will be deleted from the given MySQL table. Ok, in the below example we will delete the row of id as 1.

// Make a MySQL Connection

// Delete first row from the "employee" table

$delete_q = "DELETE FROM employee WHERE id=1";
$delete_r = mysql_query($delete_q);

Posted in MySQL