Enter your Sign-on user name and password.

Forgot password?
  • Follow us on:
Loading video...

Start Learning Now

Our free lessons will get you started (Flash® 10 required).
Get immediate access to our entire library.

Sign up for Educator.com

Features Overview

  • Get on-demand access to our complete library
  • Search and jump to exactly what you need to learn
  • Track your progress
  • Download practice and lesson files
  • *Ask questions and get answers from our community & instructors

SQL Command: DELETE

  • A DELETE statement 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 WHERE clause operates just like for SELECT statements 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 WHERE clause is simply omitted:
    DELETE FROM items;
  • Running a DELETE query from PHP works the same way as running an INSERT query from PHP because it does not return a result set. To process a DELETE query's results:
    • The result of the query() method can be tested for its truth value to test the success of the DELETE.
    • The MySQLi->affected_rows property can also be accessed to get the number of rows that were deleted.
  • 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.

Advanced PHP Training with MySQL