I have rows of data that when a save all button is pressed the contents of the changes are sent in an Email to myself.
The code below works OK, but sends each record as a separate Email. I would prefer all the data to be sent in one email.
I am guessing a loop is needed somewhere using curly brackets and perhaps a line of code like this:
while ($msg = mysqli_fetch_array($result))
Any help would be appreciated. Many thanks.
{
$email="[email protected]";
$from="[email protected]";
$msg="";
$subject="Registers Info for: ".$values["classname"]." ".$values["attendance_date"]."";
$msg.= "Student: ".$values["first_name"]." ".$values["last_name"]."\r\n";
$msg.= "Absent or Present: ".$values["attendance_status"]."\r\n";
$msg.= "Class: ".$values["classname"]."\r\n";
$msg.= "Class Date: ".$values["attendance_date"]."\r\n";
$msg.= "Amount Received: ".$values["cash_received"]."\r\n";
$msg.= "Paid For: ".$values["cash_whatfor"]."\r\n";
$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg, 'from'=>$from));
}