10-02-2018, 11:56 PM
In the edit_profile.php, i modified it to update a payment field in a Members table but it is not updating.
//Update Payment Type
if ($userdetails->payment_type != $_POST['payment_type']){
$payment_type = ucfirst(Input::get("payment_type"));
$fields=array('payment_type'=>$payment_type);
$validation->check($_POST,array(
'payment_type' => array(
'display' => 'Payment Type',
'required' => true,
'min' => 1,
'max' => 255
)
));
if($validation->passed()){
$db->update('users',$userId,$fields); I changed it to this ->([b]$db->update('member',$userId,$fields)[/b]
$successes[]='Payment Type updated.';
logger($user->data()->id,"User","Changed payment_type from $userdetails->payment_type to $payment_type.");
}else{
//validation did not pass
foreach ($validation->errors() as $error) {
$errors[] = $error;
}
}
}else{
$payment_type=$userdetails->payment_type;
}
What am i doing wrong?
//Update Payment Type
if ($userdetails->payment_type != $_POST['payment_type']){
$payment_type = ucfirst(Input::get("payment_type"));
$fields=array('payment_type'=>$payment_type);
$validation->check($_POST,array(
'payment_type' => array(
'display' => 'Payment Type',
'required' => true,
'min' => 1,
'max' => 255
)
));
if($validation->passed()){
$db->update('users',$userId,$fields); I changed it to this ->([b]$db->update('member',$userId,$fields)[/b]
$successes[]='Payment Type updated.';
logger($user->data()->id,"User","Changed payment_type from $userdetails->payment_type to $payment_type.");
}else{
//validation did not pass
foreach ($validation->errors() as $error) {
$errors[] = $error;
}
}
}else{
$payment_type=$userdetails->payment_type;
}
What am i doing wrong?