Hi,
I have a form where the data is being saved to a table using a `DB Save` element in the `On Submit` part of the form-wizard. Some data is also used to update a second table (a Community Builder table). I use a `Custom code` element with the following code:
The $fase and $id variables are displayed fine but the table `jpwjh_comprofiler` is not being updated.
I've also tried using ` in the code (see below) but this also didn't help.
What am I doing wrong or is there another way to update a second table?
Robin
I have a form where the data is being saved to a table using a `DB Save` element in the `On Submit` part of the form-wizard. Some data is also used to update a second table (a Community Builder table). I use a `Custom code` element with the following code:
<?php
$fase = $_POST['fase'];
$id = $_POST['UserID'];
echo "Fase: ".$fase." ID: ".$id;
$db =& JFactory::getDBO();
$query = "UPDATE jpwjh_comprofiler SET cb_fase=".$fase." WHERE user_id=".$id."; ";
$db->setQuery($query);
?>
The $fase and $id variables are displayed fine but the table `jpwjh_comprofiler` is not being updated.
I've also tried using ` in the code (see below) but this also didn't help.
<?php
$fase = $_POST['fase'];
$id = $_POST['UserID'];
echo "Fase: ".$fase." ID: ".$id;
$db =& JFactory::getDBO();
$query = "UPDATE `jpwjh_comprofiler` SET `cb_fase`=".$fase." WHERE `user_id`=".$id."; ";
$db->setQuery($query);
?>
What am I doing wrong or is there another way to update a second table?
Robin