Home  >  Article  >  Backend Development  >  Unknown column 'mission_name' in 'where clause'解决思路

Unknown column 'mission_name' in 'where clause'解决思路

WBOY
WBOYOriginal
2016-06-13 13:06:341299browse

Unknown column 'mission_name' in 'where clause'
php中的语句是这样的
!empty($_POST['name'])?"mission_name like '%$_POST[name]%'":null
我把sql语句拼完打出来是select * from mission where mission_name like '%er%' limit 0,2 输入sql客户端能正确的拿到内容

可是php一直在报以下错误
Unknown column 'mission_name' in 'where clause'
我试着在mission_name上加上单引号即
!empty($_POST['name'])?"'mission_name' like '%$_POST[name]%'":null

php是不报错了,但是sql又不认啊,拿出来的是空数据,到底该怎么处理呢

------解决方案--------------------
你是不是数据库搞错了?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn