Код: Выделить всё
id (int) user (int) is_complete (tinyint)
------------------------------------------------
1 24 1
2 24 1
3 24 NULL
4 24 0
5 24 0
Код: Выделить всё
$this->db->where('user', 24);
Код: Выделить всё
SELECT * FROM `table` WHERE `user` = 24
Код: Выделить всё
id user is_complete
--------------------------
1 24 1
2 24 1
3 24 NULL
4 24 0
5 24 0
Код: Выделить всё
$this->db->where('user', 24);
$this->db->where('is_complete', 1);
Код: Выделить всё
SELECT * FROM `table` WHERE `user` = 24 AND `is_complete` = 1
Код: Выделить всё
id user is_complete
--------------------------
1 24 1
2 24 1
Код: Выделить всё
$this->db->where('user', 24);
$this->db->where('is_complete !=', 1);
Код: Выделить всё
SELECT * FROM `table` WHERE `user` = 24 AND `is_complete` != 1
Код: Выделить всё
id user is_complete
--------------------------
4 24 0
5 24 0
Код: Выделить всё
$this->db->where('user', 24);
$this->db->where('is_complete ', 1);
Код: Выделить всё
SELECT * FROM `table` WHERE `user` = 24 AND `is_complete` 1
Код: Выделить всё
id user is_complete
--------------------------
4 24 0
5 24 0
Он должен вернуть:
Код: Выделить всё
id user is_complete
--------------------------
3 24 NULL
4 24 0
5 24 0
Подробнее здесь: https://stackoverflow.com/questions/187 ... gniters-qu
Мобильная версия