hi,
I have a loop on my code, i know it will show message everytime that code will run but i want that the message only show on the final count.
for ($i = 0; $i < $post_count; $i++)
{
$sql[] = "INSERT INTO pro_customer_album_price(customer_id, customer_name, customer_user_name, sl_no, album_name, paper, finish, price, vat, total_amt, date, time) VALUES ('$customer_id','$customer_name','$customer_user_name','".$sl_no[$i]."','".$album_name[$i]."','".$paper_used[$i]."','".$finishing[$i]."','".$price[$i]."','".$vat[$i]."','".$total_amt[$i]."','$date','$time')";
}
foreach ($sql as $query)
{
$data = mysqli_query($con, $query);
if(!$data)
{
echo "<br> Error".mysqli_error($con);
}
else
{
echo "Inserted!"; /// this is the message coming everytime but i want this message only show when the loop complete or in last count.
}
}
Thanks