Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Hash-clobbering in DBD's fetchrow_hashref

by gmax (Abbot)
on Aug 27, 2003 at 00:15 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-19 19:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found