11-19-2017, 04:15 PM
Sorry I already solved it
<pre></pre>
<pre>
Code:
//Update address
if ($userdetails->address != $_POST['address']){
$address = ucfirst(Input::get("address"));
$fields=array('address'=>$address);
$validation->check($_POST,array(
'address' => array(
'display' => 'address',
'required' => true,
'min' => 1,
'max' => 255
)
));
if($validation->passed()){
$db->update('users',$userId,$fields);
$successes[]='Address updated.';
logger($user->data()->id,"User","Changed address from $userdetails->address to $address.");
}else{
//validation did not pass
foreach ($validation->errors() as $error) {
$errors[] = $error;
}
}
}else{
$address=$userdetails->address;
}