PHP MySQL Delete

In some situation you need to delete the records from MySQL database. For example if a staff permanently quit the company or your company wants to removes some resellers etc., in such situation you can use The DELETE statement which quickly erases records from a MySQL table.

Syntax

<?php
DELETE * FROM tableName WHERE ID = SomeID
?>

PHP & MySQL Example Code

<?php
mysql_query("DELETE FROM Employees WHERE Name='Joy'");
or die(mysql_error());  
?>

Note: If you want to perform a large scale delete then It will be a wise choice to take a backup of Database before performing query.

Tags: ,

Related posts:

HTML5 page structure

HTML5 offers more powerful structure comparing to older versions of Html. There are many new …


Partner with Us

We are providing an exclusive partnership offer to individuals and companies who are interested in setting up their own web design & development company. For more information about how to partner with us, please contact us