[insert_php]
global $wpdb;
$sql = “SELECT ac.uname, a.booked_time_customer, a.email, a.question FROM qt1ltt_cpabc_appointments a JOIN qt1ltt_cpabc_appointment_calendars ac ON a.calendar = ac.id ORDER BY a.ID DESC LIMIT 1”;
$results = $wpdb->get_row($sql, ARRAY_A); // return result of pre-written messages
if ($results) {
echo “
Report Booking Confirmation
“;
echo “The following booking has been made by you. The booking has been emailed to “.$results[’email’].”
“;
echo $results[‘uname’].”
“;
echo $results[‘booked_time_customer’].”
“;
echo $results[‘question’].”
“;
}
[/insert_php]