警告:array_combine()期望参数2为数组,给定字符串 在E:\ Developy \ xampp \ htdocs \ car_clinic \ web \ func \ add_car_func.php中 第53行
警告:为中的foreach()提供了无效的参数 E:\ Developy \ xampp \ htdocs \ car_clinic \ web \ func \ add_car_func.php在线 53
这是我的代码
if($result == true)
{
$process = $_POST['process'];
for($i=0; $i<count($_FILES['process_img']['name']); $i++)
{
$process_img = $_FILES['process_img']['name'][$i];
$tmp_img = $_FILES['process_img']['tmp_name'][$i];
move_uploaded_file($tmp_img,"car_imgs/$process_img");
}
foreach(array_combine($process,$process_img) as $p => $p_img)
{
$sql = "INSERT INTO `process`(`proccess`, `status`, `car_id` , `process_img`) VALUES ('$p' , 'In Progress' , '$car_id' , '$p_img')";
$result = $DB->query($sql) or die ("failed to query".mysqli_error($DB));
}
}