Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/64.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 遇到类似sql的问题_Php_Mysql_Sql - Fatal编程技术网

Php 遇到类似sql的问题

Php 遇到类似sql的问题,php,mysql,sql,Php,Mysql,Sql,我有以下疑问: SELECT * FROM `alerts` WHERE `title` LIKE `%template%` 这应该会返回至少3个标题包含单词“template”的结果,但我发现以下错误:- 1054-where子句中的未知列“%template%” 据我所知,它在语法上是正确的,并且调用了正确的列名。我缺少什么?对%template%使用单引号: SELECT * FROM `alerts` WHERE `title` LIKE '%template%' 对%templ

我有以下疑问:

SELECT * FROM `alerts` WHERE `title` LIKE `%template%` 
这应该会返回至少3个标题包含单词“template”的结果,但我发现以下错误:-

1054-where子句中的未知列“%template%”
据我所知,它在语法上是正确的,并且调用了正确的列名。我缺少什么?

%template%
使用单引号:

SELECT * FROM `alerts` WHERE `title` LIKE '%template%' 

%template%
使用单引号:

SELECT * FROM `alerts` WHERE `title` LIKE '%template%' 

传奇谢谢!你知道吗,当你看得太久的时候,你错过了这样的东西,谢谢你,伙计。谢谢你!你知道当你看着它太久的时候,你错过了这样的东西,谢谢,伙计。