I'm having email fits with "After Record Added" and "After Record Updated" events. The same code is in both but the edit will not work. I keep getting
PHP error happened
Technical information
Error type 2
Error description Invalid argument supplied for foreach()
URL gacsfl.com/spin/Medication_edit.php?
Error file /hermes/bosweb/web060/b608/ipw.gacsflco/public_html/spin/Medication_edit.php
Error line 294
SQL query update `Medication` set `age`='13', `teacher`='l', `medication`='dgddhg', `details`='fdhdhgd', `home_phone`='3634536346', `work_phone`='', `cell_phone`='' where UNIQUE_ID='' and (FAMILY_CODE='Alo0001')
The following is the code used in both sections:
$email="me@email.com";
$message=$values["FIRST_NAME"] . " " . $values["LAST_NAME"] . " (" . $values["homeroom"] . ")";
$subject="New Medication Record Added";
mail($email, $subject, $message);
If I take out the email code for the "After Record Updated", the edit screen works correctly. Placing the code in the "Before Record Updated" doesn't work either.
Also, the canned routine for sending deails in the message gives the same error. It works correctly for the add.
Any help would be greatly appreciated.
Sincerley,
Joe Alongi