Welcome Guest, Not a member yet? Register   Sign In
Gets too much data
#4

CI2 doesn't have a way to automatically add them and only produces basic queries, not the more complex ones. CI3 is a bit better with that.

I just usually use $this->db->query(raw_sql) for more complex queries.

but you can also use a string in active record for WHEREs, like:
PHP Code:
$this->db
  
->where('something''any')
  ->
where('(something_else = cond2 OR something_new = cond3)'); 

Would produce:
WHERE something = 'any'
AND (something_else = cond2 OR something_new = cond3)

If cond2 or cond3 are user input, you'd have to db::escape() them manually.
Reply


Messages In This Thread
Gets too much data - by Toddles - 04-24-2015, 01:03 PM
RE: Gets too much data - by CroNiX - 04-24-2015, 01:13 PM
RE: Gets too much data - by Toddles - 04-24-2015, 01:18 PM
RE: Gets too much data - by CroNiX - 04-24-2015, 01:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB