1 (edited by StevenBullen 2008-02-05 23:17)

Topic: Adding to query (question)

Stupid question... hmm

Ok this

$query['SELECT'] .= ', u.blah';

adds to this

'SELECT'    => 'blah, blah'

My question is how do I add an addition to this one...

    'JOINS'        => array(
        array(
            'INNER JOIN'    => 'forums AS f',
            'ON'            => 'c.id=f.cat_id'
        ),
        array(
            'LEFT JOIN'        => 'forum_perms AS fp',
            'ON'            => '(fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].')'
        )
    )

Re: Adding to query (question)

What do you want to do, add another join?

Re: Adding to query (question)

Yeah a left join.

array(
            'LEFT JOIN'        => 'forum_perms AS fp',
            'ON'            => '(fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].')'
        )

that for example.

Re: Adding to query (question)

$query['JOINS'][] = array(stuff)

Re: Adding to query (question)

Cheers smartys will give that a go.

Re: Adding to query (question)

I want to add an other table in INNER JOIN. How can I do that ?

Re: Adding to query (question)

$query['JOINS'][] = array(
    'INNER JOIN'    => 'forums AS f',
     'ON'            => 'c.id=f.cat_id'
);

For example

Re: Adding to query (question)

Thanks Smartys smile