marcq
Member
Hi,
First time I'm trying to do this.
I would like to generate with a if elseif loop 2 different queries according the value of a radio button :
If value == 1 -> generate query one
Else value == 0 -> generate query two
I have tried the following, but without success :
I guess I have a missbuilding here, I get the values of the fields I need, but no data is naturaly saved in the database field.
Would appreciate some support here. Thank you in advance. Cheers, marc
First time I'm trying to do this.
I would like to generate with a if elseif loop 2 different queries according the value of a radio button :
If value == 1 -> generate query one
Else value == 0 -> generate query two
I have tried the following, but without success :
Code:
// Get the logged in Userid
$user = JFactory::getUser();
$userid = $user->get('id');
// var_dump($userid);exit;
// Get the row Id
$rowid = $formModel->formData['id'];
// var_dump($rowid);exit;
// Know of user enrolled or not
$join = $formModel->formData['integration_equ'];
// var_dump($join);exit;
// Insert or update the "fab_inscriptioneve_repeat_membre" table
if ($join==1)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query = "INSERT INTO fab_inscriptioneve_repeat_membre (parent_id,membre) VALUES ('$rowid','$userid')";
$db->setQuery($query);
$crewjoin=$db->execute();
} else ($join==0) {
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query = "DELETE FROM fab_inscriptioneve_repeat_membre WHERE membre='$userid'";
$db->setQuery($query);
$crewquit=$db->execute();
I guess I have a missbuilding here, I get the values of the fields I need, but no data is naturaly saved in the database field.
Would appreciate some support here. Thank you in advance. Cheers, marc