时间:2021-07-01 10:21:17 帮助过:5人阅读
$_POST['a'] = '1,2,3,4,5';
$_POST['b'] = "a,b,c,d,e";
$_POST['c'] = "男,女,女,男,男";
$_POST['d'] = "25,26,27,26,26";
$a = explode(',', $_POST['a']);
$b = explode(',', $_POST['b']);
$c = explode(',', $_POST['c']);
$d = explode(',', $_POST['d']);
foreach($a as $key=>$value){
$sql = "inser into tbl_name values('$value', '{$b[$key]}', '{$c[$key]}', '{$d[$key]}');";
//mysql_query($sql);
echo $sql, PHP_EOL;