Re: How to "INNER Join" in Model ?

2007-12-07 Thread Baz
Didn't work for me. On Dec 7, 2007 8:47 AM, foxmask <[EMAIL PROTECTED]> wrote: > > Nice ! > > > On Dec 6, 10:48 pm, nate <[EMAIL PROTECTED]> wrote: > > > class ForumPerm extends AppModel { > > var $name = 'ForumPerm'; > > var $primaryKey = 'group_id,forum_id'; > > //The A

Re: How to "INNER Join" in Model ?

2007-12-07 Thread foxmask
Nice ! On Dec 6, 10:48 pm, nate <[EMAIL PROTECTED]> wrote: > class ForumPerm extends AppModel { > var $name = 'ForumPerm'; > var $primaryKey = 'group_id,forum_id'; > //The Associations below have been created with all possible > keys, > those that are not needed can be r

Re: How to "INNER Join" in Model ?

2007-12-06 Thread nate
array('type' => 'INNER'), 'Forum' => array('type' => 'INNER') ); } On Dec 6, 12:28 pm, Baz <[EMAIL PROTECTED]> wrote: > I'm sorry, I'm a bit lost. > > Could you explain this a lil more? > > On Dec 6, 2007 10:15 AM, nate <[EMAIL PROTECTED]> wrote: > > > > > On 1.2

Re: How to "INNER Join" in Model ?

2007-12-06 Thread Baz
I'm sorry, I'm a bit lost. Could you explain this a lil more? On Dec 6, 2007 10:15 AM, nate <[EMAIL PROTECTED]> wrote: > > On 1.2 you can set the 'type' key in the association, which defaults > to "LEFT". > > On Dec 6, 7:39 am, foxmask <[EMAIL PROTECTED]> wrote: > > Hi Baz > > We suggested me t

Re: How to "INNER Join" in Model ?

2007-12-06 Thread nate
On 1.2 you can set the 'type' key in the association, which defaults to "LEFT". On Dec 6, 7:39 am, foxmask <[EMAIL PROTECTED]> wrote: > Hi Baz > We suggested me to do this : > > in the topics controller : > function lastTopics(){ > $sql = > "SELECT Topic.id, Topic.subject FROM topics AS Topic IN

Re: How to "INNER Join" in Model ?

2007-12-06 Thread foxmask
Hi Baz We suggested me to do this : in the topics controller : function lastTopics(){ $sql = "SELECT Topic.id, Topic.subject FROM topics AS Topic INNER JOIN forums AS Forum ON Forum.id = Topic.forum_id LEFT JOIN forum_perms AS ForumPerm ON (ForumPerm.forum_id=Forum.id AND ForumPerm.group_id='xxx

Re: How to "INNER Join" in Model ?

2007-12-05 Thread Baz L
I ran into a need for this today. In the interest of time, I just trim the array I get back after the fact, however...is there someway to do this? -- Baz L Web Development 2.0 http://WebDevelopment2.com/ On Dec 1, 1:30 pm, foxmask <[EMAIL PROTECTED]> wrote: > gooed evening > any idea aboutinner

Re: How to "INNER Join" in Model ?

2007-12-01 Thread foxmask
gooed evening any idea about inner join ? On Nov 29, 12:39 pm, foxmask <[EMAIL PROTECTED]> wrote: > Hi i'd like to know what i need to do and in what model, to be able to > use this SQL query > > SELECT t.id, t.subject FROM topics AS t INNER JOIN forums AS f ON > f.id=t.forum_id LEFT JOIN forum_p

How to "INNER Join" in Model ?

2007-11-29 Thread foxmask
Hi i'd like to know what i need to do and in what model, to be able to use this SQL query SELECT t.id, t.subject FROM topics AS t INNER JOIN forums AS f ON f.id=t.forum_id LEFT JOIN forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='xxx') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND