当计划当作sql指令的一部分时:如果参与控制的字段是数值型的,则 以下是引用片段: if(! empty($_POST['checkbox'])) { $expr = join(",", $_POST['checkbox']); $sql = "select * from tbl_name where field in ($expr)"; }
如果参与控制的字段是数值型的,则 以下是引用片段: if(! empty($_POST['checkbox'])) { $expr = "'".join("','", $_POST['checkbox'])."."; $sql = "select * from tbl_name where field in ($expr)"; }