Welcome Guest, Not a member yet? Register   Sign In
Relating the two fields into one record
#1

[eluser]konradinho[/eluser]
Hi there. My table looks like this:

Table match

id
team_1
team_2

Table club

id
team_name

How to combine these tables and then refer to them in this way:

Code:
$item->team_name_1;
$item->team_name_2;

I tried to call the function:

Code:
$this->db->join('club', 'club.id = match.team_1 and club.id = match.team_2');

But it did not work. You can also break it into two functions, one gets the data on one team and one on the second team But I wanted to do it in one function.

Thank you in advance for your help.


Messages In This Thread
Relating the two fields into one record - by El Forum - 08-24-2012, 02:28 AM
Relating the two fields into one record - by El Forum - 08-24-2012, 07:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB