$array = array();
foreach ($Addproduct_image as $row) {
$array[] = '("' . mysql_real_escape_string($row["image"]) . '", ' . $row["color"] . ' , ' . $last_ID .')'; }
$stmt1 = $this->con->prepare("INSERT INTO Product_img_col (image, color, pro_ID) VALUES '.implode(",", $array[])");
if ($stmt1->execute()) {return true;} else{return false;}
// Data to add.
{"name":"world","color":"world",($Default_Value)}]
I want to add this data into multiple rows. I think I will have to use implode function for multiple rows with a default value for third column "$default-value". I am not very good in PHP can anyone please help .
Product_img_col(image, color, pro_ID) VALUES '.implode(",", $array[])"); print_r($array); if ($stmt1->execute()) {return true;} else{return false;} I tried this