This is entirely off the top of my head (but then, a lot of things are off the top of my head....), and may not be at all suitable for your purposes - but it does retain the "table/field" information in the records.
It's to add another dimension to the result arrays, indexed by table.
while($row=mysql_fetch_assoc($result))
{$resultTable['MyTable']=$row;}
It means instead of referring to $resultTable['MyTable.myfield'] you'd be referring to $resultTable['MyTable']['myfield'] instead, but it does mean you wouldn't have to do those extra loops.
I did have another idea wherein re-keying is deferred until the field is actually requested (when $record['table.field'] is wanted, look to see if it is set, if not, create it from $record['field']), but that would be a sight more complicated (probably want to turn record arrays into record objects with suitable methods to handle all the deferral stuff transparently.) Like I say, probably more complicated.
Gotta go, batteries running flat.