CodeIgniter Forums
Not printing array - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Not printing array (/thread-49242.html)



Not printing array - El Forum - 02-12-2012

[eluser]xtremer360[/eluser]
I just have no idea when I even do a test run of this controller it does not print the $user_data inside the library activate_user function. I'm not seeing why it wouldn't. Does anyone else? Because clearly what I want to do is match the input with what is store in the database. I'm not getting any errors its just not showing the array.

Activate user form:

http://www.kansasoutlawwrestling.com/kowmanager/activate/10000/9f5b8139fdb9c50543cdf916eb38f686

Library

Code:
function activate_user($user_id, $registration_key, $password)
{
    $this->ci->users->purge_na();

    if ((strlen($user_id) > 0) AND (strlen($registration_key) > 0))
    {
        $user_data = $this->ci->users->get_user_by_user_id($user_id);
        print_r($user_data);
        $genPassHash = $this->ci->genfunc->GenPassHash($password);
        echo '<br />';
        print_r($genPassHash[0]);

        if ($user_data['password'] == $genPassHash[0])
        {
            return $this->ci->users->activate_user($user_id, $registration_key, $reGenFromPostPW[]);
        }
        else
        {
            return false;                
        }
    }
    else
    {
        return false;
    }  
}




Not printing array - El Forum - 02-12-2012

[eluser]CroNiX[/eluser]
Try putting a die(); immediately after it. Since your returning...it's probably flashing it on the screen faster than you can see it before displaying something else.


Not printing array - El Forum - 02-12-2012

[eluser]xtremer360[/eluser]
Refresh my link because that didn't do anything for me.


Not printing array - El Forum - 02-12-2012

[eluser]Aken[/eluser]
Or not entering the IF statement in the first place.


Not printing array - El Forum - 02-12-2012

[eluser]xtremer360[/eluser]
It was because it was printing out $genPassHash[0])