Welcome Guest, Not a member yet? Register   Sign In
User Login Page?
#14

[eluser]ywftdg[/eluser]
Curious on something in your auth library. I am trying to set the cookie to something else than the say user name, in my case username is the email. I want to use my user's id from the database instead for the cookie. I have been trying this, but its not working. Maybe I am just using the query variable wrong here, or maybe i'm missing something al together?

Code:
// Query time
    $this->CI->db->where('dEmail', $email);
    $this->CI->db->where('dPassword', $password);
    $query = $this->CI->db->get('designer');
    
    if ($query->num_rows() == 1)    {
        // Our user exists, set session.
        $designerid = $query[0]; //First item in array would be the designerid
        $this->CI->session->set_userdata('logged_user', $designerid );
        return TRUE;
    }     else {
        // No existing user.
        return FALSE;
        }
    }

Update, was able to fix changing to grab the row via:

Code:
foreach ($query->result() as $row) {
            $designerid = $row->dDesignerId;
        }


Messages In This Thread
User Login Page? - by El Forum - 07-28-2008, 09:01 AM
User Login Page? - by El Forum - 07-28-2008, 09:52 AM
User Login Page? - by El Forum - 07-28-2008, 11:38 AM
User Login Page? - by El Forum - 07-28-2008, 01:11 PM
User Login Page? - by El Forum - 07-28-2008, 08:23 PM
User Login Page? - by El Forum - 07-28-2008, 09:41 PM
User Login Page? - by El Forum - 07-28-2008, 11:34 PM
User Login Page? - by El Forum - 07-28-2008, 11:53 PM
User Login Page? - by El Forum - 07-29-2008, 09:59 AM
User Login Page? - by El Forum - 07-29-2008, 10:59 AM
User Login Page? - by El Forum - 07-29-2008, 11:24 AM
User Login Page? - by El Forum - 07-29-2008, 09:59 PM
User Login Page? - by El Forum - 07-30-2008, 01:35 AM
User Login Page? - by El Forum - 07-30-2008, 04:25 AM
User Login Page? - by El Forum - 07-30-2008, 05:42 AM
User Login Page? - by El Forum - 07-30-2008, 10:00 PM
User Login Page? - by El Forum - 09-24-2008, 09:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB