MySQL Tutorial Delete a record simple method, should say is the simplest entry-level, let's take a look at how to use MySQL SQL statement to delete a record bar.
Mysql>delete from table name where id=1;
Query OK,
So that you can delete the
If you and PHP tutorial MySQL configuration just use PHP to connect to the database tutorial then use PHP mysql_query ("Delete from table name where id=1");
<?php
$con = mysql_connect ("localhost", "Peter", "abc123");
if (! $con)
{
Die (' Could not connect: '. Mysql_error ());
}
mysql_select_db ("my_db", $con);
mysql_query ("Delete from the person where Lastname= ' Griffin '");
Mysql_close ($con);
?>
Here's a look at the MySQL delete syntax.
Delete data from a database
The delete from statement is used to delete records from a database table.
Grammar
Delete from table_name
WHERE column_name = Some_value
Note: SQL is not sensitive to case. Delete from is equivalent to delete from.
In order for PHP to execute the above statement, we must use the mysql_query (function). This function is used to send queries and commands to a SQL connection