How does MySQL interpret the underscore (_) character in SQL queries?

MySQL interprets the underscore (_) character as a wildcard in SQL queries. This means that when you use the underscore in a query, it will match any single character in that position. To use the underscore character as a literal character in a query, you need to escape it by using the backslash (\) before it.

$query = "SELECT * FROM table_name WHERE column_name LIKE 'test\_value'";