In mysql, like fuzzy queries do not support diagonal line queries, because in normal cases, the backslash in mysql is negotiable, next I will show you how to use MySqlLIKE to find records with Backlash. If you need it, please refer to it.
In mysql, like fuzzy queries do not support diagonal line queries, because in normal cases, the backslash in mysql is negotiable, next I will show you how to use MySql LIKE to find records with backslashes. If you need them, please refer to them.
Use or \ To see how you define the string. In fact, there are only two escape types: PHP and MySQL.
If you use double quotation marks "" to define a string in PHP, an escape occurs here. If you use single quotes, they will not be escaped.
$ SQL = "SELECT * FROM table WHERE col LIKE '% a \ %'";
In this way, what is actually escaped to MySQL?
SELECT * FROM table WHERE col LIKE '% a \ % ';
If you use single quotes, they will not be escaped (except single quotes, of course, the variables will not be expanded ):
$ SQL = 'select * FROM table WHERE col LIKE '% a \ % '';
Also sent to MySQL
SELECT * FROM table WHERE col LIKE '% a \ % ';