[eluser]Jbeasley6651[/eluser]
I did a quick browse of the thread and didn't find anyone talking about the bug i found this morning so i'll post it. (sorry if it's been posted)
I was building an app to save the users information into a profile and I was trying to get the logged in users ID, no luck because you need to change the following.
in Auth.php on line 237 and line 144
From
Code:
'user_id' => $row['id'],
to
the script is writing the column "user_id" to the session data and this is not a valid field in the database. You need to change it to "id"
Then, if you wanna make it easier on yourself to use the user id in multiple places open up the auth_helper and find this
Code:
function username()
{
$CI =& get_instance();
return $CI->session->userdata('username');
}
directly below it add this
Code:
function userid()
{
$CI =& get_instance();
return $CI->session->userdata('id');
}
Now, where ever you would like to use the user id you can simple use
Code:
<?php echo userid(); ?>
Thanks,
Joel Beasley