simple question about select .. where |
Good day!
This is my table 'test' CREATE TABLE `test` ( `id` int(11) NOT NULL AUTO_INCREMENT, `n` varchar(100) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8 id | n 2 | 2 3 | 123 This is my code PHP Code: $query = $this->db->select('*')->where('id',$id)->get('test'); This is result id = '3' array(1) { [0]=> array(2) { ["id"]=> string(1) "3" ["n"]=> string(3) "123" } } id = '3r' array(1) { [0]=> array(2) { ["id"]=> string(1) "3" ["n"]=> string(3) "123" } } Why? Whe not empty or error? Thank you
@Sarog,
Why you are receiving a record: https://stackoverflow.com/questions/1678...with-index Try this: http://sqlfiddle.com/#!9/101556/5 Echo out the executed SQL statement so we can see exactly what is being sent to the database. |
Welcome Guest, Not a member yet? Register Sign In |