$id=array(23,24); $sql =" select `series_title` FROM ca_series where id in $id";//我想查id在23,24里的内容echo $sql;输出的效果:select `series_title` FROM ca_series where id in Array想要的效果:select `series_title` FROM ca_series where id in (23,24);
你只是查的整个数组吧,并没有具体数组里的某个值。
$id = array(23,24);
$in = join(',', $id);
$sql = "select `series_title` FROM ca_series where id in ( $in)";