Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Hash-clobbering in DBD's fetchrow_hashref

by gmax (Abbot)
on Aug 27, 2003 at 00:15 UTC ( #286905=note: print w/replies, xml ) Need Help??


in reply to Hash-clobbering in DBD's fetchrow_hashref

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).

 _  _ _  _  
(_|| | |(_|><
 _|   
  • Comment on Re: Hash-clobbering in DBD's fetchrow_hashref

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://286905]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2022-12-03 22:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?