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

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



ASK A QUESTION

More mysql PHP Questions

What is the correct way to connect to a MySQL database?

Why does this code not work? Returns this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND ClaimNo = AND UserName = john' at line 2

Welcome by regersteration form First name: last name:

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

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



Custom Search