Welcome Guest, Not a member yet? Register   Sign In
simple question about select .. where
#1

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');
 
       return $query->result_array(); 


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
Reply


Messages In This Thread
simple question about select .. where - by Sarog - 05-22-2019, 02:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB