Welcome Guest, Not a member yet? Register   Sign In
dbprefix on multiple join conditions
#2

[eluser]Unknown[/eluser]
Hi:

My solution was adding dbprefix manually:
Code:
$this->db->join('table',
  't1.field1 = t2.field2 AND '.$this->db->dbprefix.'t1.field3 = '.$this->db->dbprefix.'t2.field4', 'left');
Edited: better yet: using _protect_identifiers

Code:
$this->db->join('table',
  't1.field1 = t2.field2 AND'.
  $this->db->_protect_identifiers('t1.field3').
  '='.
  $this->db->_protect_identifiers('t2.field4'), 'left');


Messages In This Thread
dbprefix on multiple join conditions - by El Forum - 06-11-2009, 01:36 AM
dbprefix on multiple join conditions - by El Forum - 04-12-2010, 11:36 AM
dbprefix on multiple join conditions - by El Forum - 03-06-2013, 01:40 PM



Theme © iAndrew 2016 - Forum software by © MyBB