I've been using PHPRunner for 10 years and this is my first post.
My objective:
I would sincerely appreciate some insight with my issue using PHPRunner 9.8
I want one form for adding records that will do an insert on both tables (add to the Master and then to the Detail). I have two tables that are Master - Detail in relationship and are inner joined on key fields of id. I understand that MYSQL won't allow insert two tables at the same time. I'm wanting to perform this function in PHPRUNNER rather than having to write a Trigger in Mysql or write two queries using LAST_INSERT_ID ().
To keep it simple I'm just working with one field on the inner join table (call_notes_c), which is in the detail table. I have many more; however if someone can point me in the right direction I'll be able to add more fields after I understand the logic.
My Issue:
When I do an add record and fill in the inner joined fields and then save. I can't get the inner joined field (call_notes_c) from Details table (prospectcstm_crm) to do an insert into the table.
MY Tables:
Master is prospects_crm and detail is prospectscstm_crm. Key fields are prospects_crm = id and foreign key in prospectscstm_crm = id_c. Both tables (prospect_crm and prospectcstm_crm have Auto Increment on the Key fields = id.
My Query:
SELECT
prospects_crm.id,
prospects_crm.FirstName,
prospects_crm.LastName,
prospects_crm.FullName,
prospects_crm.MobilePhone,
prospects_crm.Address,
prospects_crm.City,
prospects_crm.State,
prospects_crm.Zip,
prospectscstm_crm.call_notes_c
FROM prospects_crm
INNER JOIN prospectscstm_crm ON prospects_crm.id = prospectscstm_crm.id
//////////////////////
My Event Code:
Prospects_Crm/Add Page /Before Record Added
global $dal;
$tblDetail = $dal->Table("prospectscstm_crm");
$tblDetail->Value["call_notes_c"] = $values["call_notes_c"];
$tblDetail->Value["id_c"] = $keys["id"];
$tblEvents->Add();
unset($values["call_notes_c"]);
unset($values["id_c"]);
return true;
/////////////////
In addition, does PHPRunner support LAST_INSERT_ID() in the events code?
Thanks in advance for help.
My objective:
I would sincerely appreciate some insight with my issue using PHPRunner 9.8
I want one form for adding records that will do an insert on both tables (add to the Master and then to the Detail). I have two tables that are Master - Detail in relationship and are inner joined on key fields of id. I understand that MYSQL won't allow insert two tables at the same time. I'm wanting to perform this function in PHPRUNNER rather than having to write a Trigger in Mysql or write two queries using LAST_INSERT_ID ().
To keep it simple I'm just working with one field on the inner join table (call_notes_c), which is in the detail table. I have many more; however if someone can point me in the right direction I'll be able to add more fields after I understand the logic.
My Issue:
When I do an add record and fill in the inner joined fields and then save. I can't get the inner joined field (call_notes_c) from Details table (prospectcstm_crm) to do an insert into the table.
MY Tables:
Master is prospects_crm and detail is prospectscstm_crm. Key fields are prospects_crm = id and foreign key in prospectscstm_crm = id_c. Both tables (prospect_crm and prospectcstm_crm have Auto Increment on the Key fields = id.
My Query:
SELECT
prospects_crm.id,
prospects_crm.FirstName,
prospects_crm.LastName,
prospects_crm.FullName,
prospects_crm.MobilePhone,
prospects_crm.Address,
prospects_crm.City,
prospects_crm.State,
prospects_crm.Zip,
prospectscstm_crm.call_notes_c
FROM prospects_crm
INNER JOIN prospectscstm_crm ON prospects_crm.id = prospectscstm_crm.id
//////////////////////
My Event Code:
Prospects_Crm/Add Page /Before Record Added
global $dal;
$tblDetail = $dal->Table("prospectscstm_crm");
$tblDetail->Value["call_notes_c"] = $values["call_notes_c"];
$tblDetail->Value["id_c"] = $keys["id"];
$tblEvents->Add();
unset($values["call_notes_c"]);
unset($values["id_c"]);
return true;
/////////////////
In addition, does PHPRunner support LAST_INSERT_ID() in the events code?
Thanks in advance for help.