PHP查询条件where id = array(1,2,3)怎么做
回复讨论(解决方案)
where id in (1,2,3)
$id = implode(',', array(1,2,3));
$sql = "....where id in ($id) ";
使用in可以
$id = array(1,2,3);$sqlstr = "select * from table where id in(".implode(',',$id).")";
PHP查询条件where id = array(1,2,3)怎么做
where id in (1,2,3)
$id = implode(',', array(1,2,3));
$sql = "....where id in ($id) ";
使用in可以
$id = array(1,2,3);$sqlstr = "select * from table where id in(".implode(',',$id).")";
本文是由用户编写整理,所有内容的版权归原作者所有。如果侵犯了您的权益,请联系我删除