I am trying to insert data of key and value from foreach. But I am getting error saying- Notice: Array to string conversion in…..(line number 22) but I have checked both $key and $value using var_dump and found the array values are perfect. Then whats the solution to insert this $key $value data at a time to my database? also please note when i run it, the $key value is inserting successfully in db but $value value field is getting blink and getting same error in browser. you can check my db table in attached picture if required
foreach ($_POST['qty'] as $key => $value) {
mysqli_query($conn, "INSERT INTO combine (rand_id,product_id,product_qty)VALUES('$rand_id','$key','$value')");
}