Google News
logo
MySQL WHERE Clause
The WHERE clause is used to extract only those records that fulfill a specified condition.
Syntax

SELECT column_name FROM table_name WHERE column_name operator value

The SQL query using the WHERE clause in SELECT statement, after that we'll execute this query through passing it to the PHP mysqli_query() function to get the filtered data.

You can use one or more tables separated by comma to include various conditions using a WHERE clause, but WHERE clause is an optional part of SELECT command.

You can specify more than one conditions using AND or OR operators.

A WHERE clause can be used along with DELETE or UPDATE SQL command also to specify a condition.

The WHERE clause works like an if condition in any programming language. This clause is used to compare given value with the field value available in MySQLi table.