Hi,
I have a database containing 2 tables ("table1" and "table2").
table1: containing 4 fields ("id", "name", "field1", "field2")
table2: containing 2 fields ("id", "name")
"id" is the primary key and auto-increment
"name" is assigned with unique key
Below are my codes:
--------------------------
After record added in table1
global $dal;
if ($values["field1"]=="Yes" && $values["field2"]=="Yes"){
$dal_table = $dal->Table("table2");
$dal_table->name=$values["name"];
$dal_table->Add();
/The below code is my mail function, however this will only send an email containing the new record/
include "include_mail.php";
mysendmail ("email address","title",$values["name"]);
}
The above code will always create a new name in table2 whenever the if statement met.
My question is how can I send 1 email that contains all the available records(name) from table2? In other words, whenever new records created in table2, user will recieve an email with the new created "name" and previous created "name".
Thanks in advance for the help.