Loading video...
SQL Command: DELETE
- A
DELETEstatement is an SQL command used to delete rows from tables based on specified criteria. It has the syntax:DELETE FROM items WHERE itemID=1001;
- Its
WHEREclause operates just like forSELECTstatements to be able to select specific rows from a table. It can thus also use comparison & logical operations in its where condition. - To delete all of the rows from a table, the
WHEREclause is simply omitted:DELETE FROM items;
- Running a
DELETEquery from PHP works the same way as running anINSERTquery from PHP because it does not return a result set. To process aDELETEquery's results:- The result of the
query()method can be tested for its truth value to test the success of theDELETE. - The
MySQLi->affected_rowsproperty can also be accessed to get the number of rows that were deleted.
- The result of the
- Additional Resources:
SQL Command: DELETE
Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.


































Start Learning Now
Our free lessons will get you started (Flash® 10 required).
Sign up for Educator.comGet immediate access to our entire library.
Features Overview