Home  >  Article  >  Backend Development  >  Thinkphp中SQL语句有关问题

Thinkphp中SQL语句有关问题

WBOY
WBOYOriginal
2016-06-13 12:24:50729browse

Thinkphp中SQL语句问题
请问,在THINKPHP中,数据表里有个字段,字段的内容形式为 {1,2,3,4,5}
那么SQL语句里怎么将获得的ID值来跟字段里的内容来比较呢
------解决思路----------------------
用模糊查询吧 

$where = array('该字段'=>array('LIKE', '%' . $ID . '%'));

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