Deleting data using a MySQL query

Be careful with this one as if you miss the WHERE part it could delete everything in the table! To avoid that put a limit on the number of records to be deleted:

            
$cddeletequery="DELETE FROM firsttable WHERE cdReference=1 LIMIT 1";            
        

Rather than hard coding the record to be deleted you would normally let the user choose the record either from a form or with a clickable link as with UPDATE.

submit to reddit Delicious Tweet