<?php
//get a database object
$db =& JFactory::getDBO();
//get the user id value from the submitted fabrik data
$userid = JRequest::getInt('fab_uploads___user');
//query the cb table to get that users data
$db->setQuery("select #__comprofiler.*, #__users.email from #__comprofiler WHERE #__comprofiler.user_id = $userid LEFT JOIN #__users ON #__users.id = #__comprofiler.user_id");
//load the cb user info into the object $cUser
$cUser = $db->loadObject();
$formModel->updateFormData('fab_uploads___account_number', $cUser->cb_accountnumber, true);
$formModel->updateFormData('fab_uploads___user_email', $cUser->email, true);
?>
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
"SELECT c.*, u.`email` FROM `#__comprofiler` AS c LEFT JOIN `#__users` AS u ON u.`id` = c.`id` WHERE c.`id` = $userid"
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.