Welcome Guest, Not a member yet? Register   Sign In
Query returns no result?
#1

[eluser]grolle[/eluser]
Hi,

I'm using this in a function of an own lib to identify an user, but I get no result:
Code:
$sql = "SELECT * FROM ci_users WHERE username = '".$username."' AND active = 1 LIMIT 1";
$query = $this->CI->db->query($sql);
Code:
print_r($query->result());
returns an empty array.
Code:
print_r($query);
shows that there are zero num_rows.
If I do
Code:
print_r($this->CI->db->last_query());
and execute the query via phpMyAdmin everthing works fine and I get one row.

Whats wrong with this code?

Best regards...


Messages In This Thread
Query returns no result? - by El Forum - 10-18-2009, 06:55 AM
Query returns no result? - by El Forum - 10-18-2009, 07:09 AM
Query returns no result? - by El Forum - 10-18-2009, 07:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB