Welcome Guest, Not a member yet? Register   Sign In
Getting data from session syntax problem.
#1

[eluser]Katsune[/eluser]
[EDITED]
Hi,

I cant figure out what's the right syntax for this:

Code:
[$session_username = $this->session->userdata('Username');
        $sql =  "SELECT UserID FROM  username_table WHERE Username = '$session_username'";
        $insertedUserID = $this->db->query($sql);
        $shit = $insertedUserID->result_array();
        print_r ($shit);

Whenever I run this the result is:

Code:
Array ( [0] => Array ( [UserID] => 1 ) )

But what I only need is the value 1 from the UserID column. How can I get that?

Can anyone tell me how to write the right syntax for the first code above?

Thanks,


Messages In This Thread
Getting data from session syntax problem. - by El Forum - 04-07-2014, 08:55 PM
Getting data from session syntax problem. - by El Forum - 04-07-2014, 11:37 PM



Theme © iAndrew 2016 - Forum software by © MyBB