[Solved] PHP Insert multiple records into mysql from one json string [closed]


As you are trying to add all items to the query you will need to remove the [] from the implode(",", $array[]) so it reads implode(",", $array).

You could try adding echo "INSERT INTO Product_img_col (image, color, pro_ID) VALUES '.implode(",", $array[])"); to your page so you have the query that you can test in phpMyAdmin or similar. This should help you debug.

Also if color is a string you should really put it inside quotes as you have done with image.

solved PHP Insert multiple records into mysql from one json string [closed]