Concatenate 2 elements and update db

Status
Not open for further replies.

Saumier

Member
Using J 2.5.1, F 3.0.4 dev site on XAMPP

This is very simple (if you know how to do it). I have a Fab tbl (fab_profile) that contains "lastname" "firstname". This is my "extension" of the Joomla users table. I have a joined form jos_users (Joomla core table) and fab_profile. That all works great. When I update the profile on form submission, I want to update the name in Joomla users table with firstname " " lastname from the profile form elements or table.

I have spent the last day and a half going through the forum and trying any kind of code I can think of, but no success so far. I'm trying to do this with a PHP plugin (onBeforeProcess) in my Profile Update form. I'm somewhat familiar with PHP and SQL coding, but I'm having a hard time figuring out how to do it in Fabrik.

I would really appreciate someone giving me the code to do this, and tell me if I'm trying to place the coding correctly.

Thanks.
 
It looks like you may want to use calc element on the jos_users.name field. You can make this element to collect data from the firstname and lastname fields.
In calc field you have to write something like

return '{fab_profile___firstname} {fab_profile___lastname}';

or
$name = '{fab_profile___firstname} {fab_profile___lastname}';
return $name;
 
Thanks for your quick response. I may be missing something, but I've tried both ways (they really do the same thing), and what goes into the name field in jos_users table name field is

{fab_profile___firstname} {fab_profile___lastname}

not what I would expect. I tried raw, but that made no difference. It sure looks like this should work, but....

Let's keep trying, there has got to be a way.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top