There's more than one way to do things | |
PerlMonks |
Re: Hash-clobbering in DBD's fetchrow_hashrefby gmax (Abbot) |
on Aug 27, 2003 at 00:15 UTC ( [id://286905]=note: print w/replies, xml ) | Need Help?? |
I wrote a column on that :-) (Well it was months that I wanted to say this in a node!). This has nothing to do with MySQL. It's a DBI issue. If you fetch a record with fetchrow_hashref and you have more columns with the same name, you will get only one of them. See DBI recipes and look, towards the end, for a section titled "A trap to avoid with fetchrow_hashref". The solution to your problem is either using an alias in your SQL (select a.id as AID, b.id as BID) or using a different method (fetchrow_array, fetchrow_hashref). _ _ _ _ (_|| | |(_|>< _|
In Section
Seekers of Perl Wisdom
|
|