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]