PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

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!
?>



Comment on this Question and Answer >>>

ASK A QUESTION

More mysql PHP Questions

How do I find the ID of a new row added to a table?

How do I order the results of my query?

How do I update the contents of a table row?

How do I find the number of rows affected by a query?

how to write sessions in php code?



Custom Search