• Have Any Question?
  • contact@eitworld.com

MySQLi Delete Data

  • Delete query is used to delete desired rows from table.



    • To delete all the rows from table:
DELETE FROM tableName;
  • It will delete all the rows that satisfy the condition:


DELETE FROM tableName WHERE conditions;


We have following table with us-

id name salary contact
1 John 25000 7777777
2 Peter 40000 9999999
  • Now we have to delete data from the above table using following code:

<!DOCTYPE html>





$query="DELETE FROM employee WHERE name='peter'";






After running the program, the table will appear as following:

id name salary contact
1 John 25000 7777777
  • Above program will delete the row/rows in which have ‘peter’ as the value of column ‘name’.

Real Time Web Analytics