MySQL Tutorial

A database system used with PHP.

MySQL LIKE

The MySQL LIKE Operator

The LIKE operator is used in a WHERE clause to search for a specified pattern in a column.

There are two wildcards often used in conjunction with the LIKE operator:

  • The percent sign (%) represents zero, one, or multiple characters
  • The underscore sign (_) represents one, single character

Syntax:

SELECT column1, column2, ...
FROM table_name
WHERE columnN LIKE pattern;

Try It Yourself

Edit the code below and click Run to see the result live.

Source Code
Result
Topics