So far, I have discussed about connection establishment, create table, insert record, read records (select statement), update record. In this article we are going to learn about delete a record.
Following is the table which I am going to delete a record. This table name is emp_info
In the above table, I want to delete the record whose id is 4
Assuming, you have followed previous tutorials, I am focusing straight to the code.
$sql=”delete from emp_info where id=4″;
echo “record deleted successfully”;
echo “Unable delete record”:
Output: Record deleted
So after deleting the record, the table is like below.