Page 1 of 1

Combine 2 fields data into 1

Posted: 2013-11-28 21:13
by scorpio_x73
Hi and thank you all for any help.

New in appgini and in php general.

My question is that i have a table with first_name, last_name and contact_name i want the user to write the first and second name and when he saves i want the field contact_name to get the values from first_name, last_name.

I have tried to add in hooks folder and in file main_tbl_contacts (which is my table name) in the function main_tbl_contacts_after_insert($data, $memberInfo, &$args) section the following line of code $data['contact_name'] = $data['last_name'] . ' ' . $data['first_name']; but is not working.

Thanks again for any info.

Re: Combine 2 fields data into 1

Posted: 2013-11-28 22:33
by scorpio_x73
Yesssssss sorry guys i found it i had to put the code in main_tbl_contacts_before_insert and not (stupid me) in function main_tbl_contacts_after_insert

Thanks anyway.