Welcome Guest, Not a member yet? Register   Sign In
Backticks breaking complex joins when using Active Record
#1

[eluser]Nathan Pitman (Nine Four)[/eluser]
I'm using active record to return some data and need to apply a couple of conditions to a JOIN. One of these conditions evaluates as to whether a column in the joined table has a value matching a string which I provide:

Code:
$this->db->select("c.id");
  $this->db->from("clients c");
  $this->db->join("clients_programmes cp", "cp.p_close_reason='none' AND cp.client_id=c.id", "left");
  $query = $this->db->get();

However whenever I try to apply this simple join CI throws an error because backticks are inserted around the 'none' string. I'm aware that 'select' has a parameter to disable backticks but this makes no odds to the join... any ideas?

I don't really want to have to rewrite an entire function to construct the query manually and pass it to '$this->db-query()', I'm hoping there's some other way to work around this or 'insert' the join into active record without using the 'join' function???


Messages In This Thread
Backticks breaking complex joins when using Active Record - by El Forum - 08-15-2012, 06:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB