[support] Issues with pdo abstraction with 1:many data

Jeff Greenberg listmail.ayendesigns at gmail.com
Thu Jan 16 19:40:26 UTC 2014


I have the following code:

$query = db_query('SELECT * FROM table1 t1 LEFT JOIN table2 t2 ON t1.id =
t2.id');
    $msg = $query->fetchAllAssoc('id');

Since it is 1:many data, I would expect

id 1
  another t1 field
  another t1 field
  t2 value 1
      more t2 from that row
  t2 value 2
      more t2 from that row
id 2

But I only get 1 t2 row for each t1. If I do the same query (without the
fetchAllAssoc) in mysql I get the expected results.
-- 
---
drupal.org/user/367108
linkedin.com/in/jeffrgreenberg
accidentalcoder.com / ayendesigns.com
@accidentalcoder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20140116/605734c6/attachment-0001.html 


More information about the support mailing list