2、利用
当企图看成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)";
}