I'm wirtinga a plugin to update a table (the #_vm_user_info).
I was thinking about to take the info from CB (#_comprofiler) and have the following code
[code:1]
function onAfterStoreUser($user, $isnew, $succes, $msg)
{
global $mainframe;
$db =& JFactory::getDBO();
$userId = $user;
$queryGetInfo = "SELECT firstname, lastname, cb_leveringadr, cb_postno, cb_area FROM jos_comprofiler WHERE user_id=$userId";
$db->setQuery($queryGetInfo);
$row = $db->loadObjectList();
$queryPostInfo = "UPDATE jos_vm_user_info SET first_name= '$firstName', last_name= '$lastName', address_1= '$adr', zip = '$zip', city = '$area' WHERE user_id='$userId'";
$db->setQuery($queryPostInfo);
$db->query();
}
[/code:1]
The problem is that the data becomes wrong in the vm_user_info table.
I think the update of #_comprofiler happens after the pluging is trigged, which gives a problem here..
Any comments?