Issue with Query |
So I have been trying to figure this out and have hit a wall. This is the query that the profiler prints out: Code: SELECT * However, the AND status = 1 gets ignored and I don't understand why.
Code: SELECT * (11-23-2014, 09:50 PM)ivantcholakov Wrote: I can't seem to recreate that using Active Record. My current code is Code: $this->db->where("position = 1");
I think that in this case you can use IN instead of OR AND..>
PHP Code: $this->db->where_in( 'position', array(1,3)); If its not option to use IN just write your where cause inline: PHP Code: $this->db->where('(position=1 OR position = 3) AND status = 1'); Best VPS Hosting : Digital Ocean
This is possible in CodeIgniter 3:
Code: $this->db Result SQL: Code: SELECT * |
Welcome Guest, Not a member yet? Register Sign In |