How can I get success confirmation while I am using loop to insert table rows in MySql database table?
My code is like below (I am using CodeIgniter
):
foreach($bookids as $key=>$bookid)
{
$this->db->query("INSERT INTO `book` (`invoice_id`,`item_id`,`quantity`,`price`) VALUES (`$invoice_id`,`$product_id`,`$product_quantitys[$key]`,`$product_prices[$key]`)");
}
I would like to get confirmation after all rows inserted successfully.