Update a field from Community Builder
Due to the flexible nature of RSform!Pro you can even update a field from a third party table. To do this, you will have to use a script, placed on the Scripts called on form process area:
// Get a database connection $db = JFactory::getDBO(); // Get the current logged-in user's data $user = JFactory::getUser(); // Setup the query $db->setQuery("UPDATE #__comprofiler SET cb_audio1 = '".$db->escape($_POST['form']['audio'])."' WHERE user_id = '".$db->escape($user->id)."'"); // Execute it. $db->query();
The above script will update a field named cb_audio1 from the _comprofiler table with the value got from a form value, named audio.
2 persons found this article helpful.