Welcome Guest, Not a member yet? Register   Sign In
How to compare two columns in a JOIN with CI
#1

[eluser]tochie[/eluser]
hello brethren,

I want to do something like this in CI
Code:
JOIN messages_sent ON messages_sent.msg_key=$msg_key AND messages_sent.msg_from=$mem_code

I tried doing it this way but it didnt work correctly..

Code:
$this->db->join('messages_sent', 'messages_sent.msg_key='.$msg_key);
$this->db->join('messages_sent', 'messages_sent.msg_from='.$mem_code);

Please any suggests as to the correct way to compare two columns in one query...Thanks


Messages In This Thread
How to compare two columns in a JOIN with CI - by El Forum - 08-28-2009, 01:37 PM
How to compare two columns in a JOIN with CI - by El Forum - 08-28-2009, 02:21 PM
How to compare two columns in a JOIN with CI - by El Forum - 08-30-2009, 12:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB