mysql中in_array问题

MySql 码拜 10年前 (2014-04-27) 720次浏览 0个评论
 

一个表叫 table,里面有 
id  type  content      isdel
1    1        dsafds     0
2     3       dflkj         0
3    4        dsafds     1
4     2       dflkj         1
.. 更多数据

$arraylist = “”1,2,4,5″”;

需求想显示出 table 中 type 在 $arraylist 中,并且isdel = 0的内容

select * from table where isdel=0 and type in “”{$arraylist}””

无效果,请问具体是什么?

先在程序代码中检查生成的SQL语句到底是什么。
30分
$sql = "select * from table where isdel=0 and type in ""({$arraylist})""";

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明mysql中in_array问题
喜欢 (0)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!