Mysql LIKE查询不起作用

Uff*_*ffo -4 php mysql mysql-error-1064

所以我正在尝试这样的基本查询:

SELECT `City`.* FROM `city` WHERE (City 'LIKE %a%') 
Run Code Online (Sandbox Code Playgroud)

但是我得到了这个错误:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your

MySQL server version for the right syntax to use near ''LIKE %a%') LIMIT 0, 30' at line 1
Run Code Online (Sandbox Code Playgroud)

我想我错过了什么!

Way*_*tty 8

SELECT `City`.* FROM `city` WHERE (City LIKE '%a%')
Run Code Online (Sandbox Code Playgroud)

您没有正确使用单引号.

它是:

City LIKE '%a%'
Run Code Online (Sandbox Code Playgroud)

不:

City 'LIKE %a%'
Run Code Online (Sandbox Code Playgroud)