![]() |
Query returns no result? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Query returns no result? (/showthread.php?tid=23649) |
Query returns no result? - El Forum - 10-18-2009 [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"; Code: print_r($query->result()); Code: print_r($query); If I do Code: print_r($this->CI->db->last_query()); Whats wrong with this code? Best regards... Query returns no result? - El Forum - 10-18-2009 [eluser]darkhouse[/eluser] Is it using the right database? Sometimes during development we use a local database and a remote database, and sometimes the data differs (this actually just happened last week, one of my developers wasn't getting a result... because she didn't have any data in that table in her local database). I have no other suggestion if the query from last_query() is working in phpMyAdmin. Query returns no result? - El Forum - 10-18-2009 [eluser]grolle[/eluser] Hi, I think there is somewhere a problem with utf8. If I run only Code: SELECT * FROM ci_users Code: $username = $this->CI->db->escape_str($username); Best regards .. // Edit: Found it. There was Code: <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> |