<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2015-09-30 18:00 GMT-05:00 Yitzchak Scott-Thoennes <span dir="ltr"><<a href="mailto:sthoenna@gmail.com" target="_blank">sthoenna@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5">On Wed, Sep 30, 2015 at 2:41 PM, Richard Reina <<a href="mailto:gatorreina@gmail.com">gatorreina@gmail.com</a>> wrote:<br>
> Well something somewhat strange has happened. When I do: print<br>
> Dumper($pats_ref) . "\n"; from the perl module that handles the DB query it<br>
> only prints one row:<br>
><br>
> $VAR1 = {<br>
> '8' => {<br>
> 'ID' => '8',<br>
> 'ANAME' => 'KOB',<br>
> 'opp_team' => 'Cardinals',<br>
> 'YEAR' => '2015',<br>
> 'date' => '2015-09-04',<br>
> 'AMOUNT' => '2.00',<br>
> 'IDD' => '3',<br>
> 'CHNAME' => 'DWB',<br>
> 'CHLG_ID' => '12',<br>
> 'SPONSOR' => 'MPK',<br>
> 'season' => 'Fall'<br>
> }<br>
> };<br>
><br>
> This is baffling and very frustrating because when I do the exact same query<br>
> from the MySQL console it yields 3 row and not 1 row.<br>
><br>
> ID | CHLG_ID | season | YEAR | date | opp_team | NAME | NAME<br>
> | AMOUNT | sponsor |<br>
> +----+---------+--------+------+------------+----------+-----------+-----------------------------+--------+---------+-------------<br>
> | 8 | 9 | Fall | 2015 | 2015-09-04 | Cardinals | KOB | AFA<br>
> | 2.00 | MPK |<br>
> | 8 | 12 | Fall | 2015 | 2015-09-04 | Cardinals | KOB | DWB<br>
> | 1.00 | RFR |<br>
> | 8 | 12 | Fall | 2015 | 2015-09-04 | Cardinals | KOB | DWB<br>
> | 2.00 | MPK |<br>
> +----+---------+--------+------+------------+----------+-----------+-----------------------------+--------+---------+<br>
><br>
> Any insight as to why this might be happening would be greatly, greatly<br>
> appreciated.<br>
<br>
</div></div>You are telling DBI to put the results in a hash by ID. So later rows<br>
overwrite earlier ones.<br>
<br>
You probably want fetchall_arrayref( {} ) instead of fetchall_hashref,<br>
but I don't remember seeing what you want to end up doing with the<br>
data.<br></blockquote></div><br></div><div class="gmail_extra">Yitzchak,<br><br></div><div class="gmail_extra">I cannot thank you enough for your suggestion. Yes, fetchall_arrayref( {} ) worked perfectly. I still do not have a good understanding as to when to use fetchall_hashref and when to opt for fecthall_arrayref() instead. I really really appreicate your help in getting me straightened out.<br><br></div><div class="gmail_extra">Thank you again.<br></div></div>