11-15-2016, 07:27 AM
Hmmm....I have changed the code to what you suggested in reply #2819...like so: (I removed the array thingy otherwise the whole page went blank)
<pre></pre>
But it does not seem to be working. What have I done wrong?
<pre>
Code:
$emailAddress = Input::get('email');
//This is clunky, but gets back your user id of the new user
$findNewUser = $db->query("SELECT * FROM users WHERE email = ?",array($emailAddress));
$newUser = $findNewUser->first();
$newId = $newUser->id;
//now you have to decide where you want those checkboxes to go.
//the left side is the column in the db, the right side is what you are inputting
$over18=Input::get(‘over_18’);
if ($over18 == ‘on’){
$over18=1;
}else{
$over18=0;
}
$loveus=Input::get(‘love_us’);
if ($loveus == ‘on’){
$loveus=1;
}else{
$loveus=0;
}
$amhuman=Input::get(‘am_human’);
if ($amhuman == ‘on’){
$amhuman=1;
}else{
$amhuman=0;
}
//If you want this info to exist in the existing user table, you do
$db->update('users',$newId,$moreInfo);
//If you want it to be a new row in the db, let's say more_info
//note that you would also want to pass in 'id'=>$newId into the array
//above so you know whose data this is!
//$db->insert('more_info',$moreInfo);
Redirect::to($us_url_root.'users/joinThankYou.php');
}
} //Validation and agreement checbox
} //Input exists
?>
But it does not seem to be working. What have I done wrong?