MySQL DatabaseLesson 66Free preview
MySQL Where
This lesson is part of PHP · All levels
Summary
The WHERE clause filters the line so that only data that qualifies for a certain qualification will be included. Comparative operators such as =, >, <, LIKE, and BETWEEN are used to compile conditions, whereas NULL is checked with IS NULL. When the value comes from the user input, always wrap it up with a prepared statement.
Key points
- WHERE is placed after FROM to limit the line taken.
- Use IS NULL to check the empty value, not = NULL.
- WHERE filters the line before the aggregation, while HAVING filters the result of GROUP BY.
- The dynamic value of the user must pass through the binding parameter to be secure.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.