Hi,

If you enable the Web Debug Toolbar, you will be able to see the actual SQL
query run by doctrine, so you ll be able to compare it with the one you
wrote.
(the toolbar is enabled in the dev environment, if you created it)



2010/3/17 anru chen <[email protected]>

> i am working on project use symfony and doctrine.
>
> I have met a strange problem, if i am use raw sql , the return results
> are right,
> if i am use $q = Doctrine_Query::create()
>           ->select(...)  , return results are wrong.
>
> example:
>
> i have a varaible $sql which contains a raw sql.
> to let doctrine execute raw sql, i am use following code.
>
> $dbh = Doctrine_Manager::getInstance()->getCurrentConnection()->getDbh();
> $results = $dbh->query($sql)->fetchAll();
>
> now, $results will contains 6 records.
>
> if i am use $q = Doctrine_Query::create()
>           ->select(...) ->innerJoin(..)...
> $results = $q->fetchArray();
>
> above $results only return 3 record.
>
> I did not dug into doctine source code, i guess the doctrine did some
> smart thing , probably it think some records have
> same  key, those recodes must same, so it merge those records into one .
>
> so, any one met this kind of problem before?
>
> PS.
>
> probably our db schema is not right, but i have no right to change it.
>
> --
> NZ PHP Users Group: http://groups.google.com/group/nzphpug
> To post, send email to [email protected]
> To unsubscribe, send email to
> [email protected]<nzphpug%[email protected]>




-- 
Mikael Letang
Mobile: 021 027 436 45
Skype: mikaelletangns

-- 
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]

Reply via email to