Welcome Guest, Not a member yet? Register   Sign In
flexi auth - A user authentication library for CodeIgniter

[eluser]haseydesign[/eluser]
@NotSmilie

The general flow of your function looks correct, with a possible exception to the table names (Which you mention you're unsure of).

The array keys and values that your are passing to the update_user() function need to reflect the exact name of the table column you are updating and the value you are updating it to.

Therefore, assuming you haven't changed any column names from the default, your code would look a little like the following: (Note: I tidied the code duplication you were using)
Code:
$user_data = array(
  'uacc_email' => $_POST['uacc_email'],
  'uacc_username' => $_POST['uacc_username'],
  'uacc_group_fk' => $_POST['uacc_group_fk'],
  'uacc_credits' => $_POST['uacc_credits'] // This is your own custom column, so make sure the name matches.
);

if ($_POST['uacc_password'] != '')
{
  $user_data['uacc_password'] = $_POST['uacc_password'];
}
An important note is to ensure that the form inputs your are retrieving from $_POST are named as you have put them above (Since those names are also the same as the database column names). Also ensure the $user_id is correct.

If you're unsure how to check the content of these variables, use the following code:
Code:
echo '<pre>';
print_r($_POST);
exit;

If you're still stuck, check out the demo that is included with the library and look at the update_account() method within the demo_auth_model.php file, as that has a similar example.


Messages In This Thread
flexi auth - A user authentication library for CodeIgniter - by El Forum - 03-10-2013, 03:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB