Welcome Guest, Not a member yet? Register   Sign In
select join result
#1

[eluser]Klaats[/eluser]
Hi,

Maby it's a dumb question and it's easy but i'm looking for days now and i can't find it.

So my join Query is working like a charm and it puts the results in an multi-array like this:

Array[0]
- id
- name
- last name
- Array [0] ( -> this is from second table with the join )
- id
- ...
- Array [1]
- id
- ...
- Array [2]
- id
- ...
Array[1]
- id
- name
- last name
- Array [0]
- id
- ...


And so on and on ..

now i use in my view and the result works perfect but not for the nested array's

Code:
foreach($items as $item):
echo $item->name,$item->lastname;
endforeach;

So how do you get the other nested array's ?

Thanks in Advance
#2

[eluser]Klaats[/eluser]
hmmm ok i feel f*cking stupid , i found it Big Grin

May delete this topic.

Thx
#3

[eluser]Media Gearhead[/eluser]
Could you post your join query that you are using as I am trying to format my data like that off a query but it isn't behaving how I would like.
#4

[eluser]Klaats[/eluser]
This is my query:

Code:
$SQLwedstrijd    = Doctrine_Query::create()
                 ->select('n.*, p.*')
                 ->from('Kicker_wedstrijd n')
                 ->where('n.type = "competitie"')
                 ->orderBy('n.datum DESC')
                 ->innerJoin('n.sets p')
                 ->groupBy('p.id')
                 ->execute();

$data['wedstrijd'] = $SQLwedstrijd;
#5

[eluser]Media Gearhead[/eluser]
Thanks. Will have to check this out tomorrow...




Theme © iAndrew 2016 - Forum software by © MyBB