PHP Questions Home

Categories

Arrays
Files
Forms
Functions
Images
MySQL
Numbers
Others
Strings
Website


PHP Functions

PHP Functions


More PHP

Top Questions
Ask a Question

How do I delete a row from a table?


This is done using the DELETE command.

And unlike recycle bins and dodgy deletion of data on PCs, when you DELETE it is gone!

Here is how you do it:

<?php
$query 
"DELETE from mytable";
//when you run that, it's gone!

//notice that you DON'T do this
$query "DELETE * FROM mytable";//error!
?>



More mysql PHP Questions

How do I include a conditional in my mysql query?
How do I set a default value for ENUM fields in PHP?
How do I connect to mySQL from PHP?
How do I update the contents of a table row?
How do I find second highest value from a table?