Thanks Colin,
I tried that too. This doesn't work. Doctrine creates this sql, note
the missing comma:
SELECT p.propertyid AS p__propertyid, s.suburb AS s__suburb FROM
properties p suburbs s

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an
error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near 'suburbs s' at
line 1

The relationship is setup:

class AroProperties extends BaseAroProperties
{
  public function setup(){
    $this->hasOne(
       'AroSuburbs'
      ,array(
         'local' => 'suburbId'
        ,'foreign' => 'suburbId'
      )
    );
  }
}

Am I missing something here? Somebody please tell me doctrine can
handle a simple cross join.
I ditched propel in favor of doctrine for a performance improvement. I
was just hoping doctrine could at least handle simple queries like
this.


On Jul 30, 11:04 pm, "Colin Williams" <[EMAIL PROTECTED]> wrote:
> Without having tested it, I believe it would be something like this:
>
> $result = $q->select('p.propertyid, s.suburb')->from('AroProperties p,
> p.AroSuburbs s')->execute(array(), Doctrine::FETCH_ARRAY);
>
> Assuming you have the foreign relationships set up correctly.  If your
> suburb object is name AroSuburb, and not AroSuburbs, then use that instead
> in the above.
>
> --Colin
>
> On 7/30/07, Charles Hilditch <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > I couldn't find an active phpdoctrine mailing list to ask this question...
> > How would I achieve this simple cross join in doctrine?
>
> > SELECT p.propertyid, s.suburb FROM properties p, suburbs s WHERE
> > p.suburbId = s.suburbId
> > ...or...
> > SELECT p.propertyid, s.suburb FROM properties p CROSS JOIN suburbs s ON
> > p.suburbId = s.suburbId
>
> > // I thought the syntax may go something like:
> > $result = $q->
> >     select(' p.propertyId, s.suburb')->
> >     from('AroProperties p, AroSuburbs s')->
> >     where('p.suburbId = s.suburbId')->
> >     execute(array(), Doctrine::FETCH_ARRAY);
>
> > Thanks!
>
> > --
> > Charles Hilditch
> > Web Developer
> > Mob: 0415 166 137
> > [EMAIL PROTECTED]
> >http://www.crh-systems.com/
>
> --
> "Doh!"  - Homer Simpson


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to