good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
DBI returning error on selectrow_hashrefby bradcathey (Prior) |
on Nov 28, 2005 at 16:15 UTC ( [id://512244]=perlquestion: print w/replies, xml ) | Need Help?? |
bradcathey has asked for the wisdom of the Perl Monks concerning the following question: Fellow Monasterians>/p> I'm trying to learn and apply the selectrow/col/all methods in the DBI. Most everything has worked, with the exception below. The table in question, 'users' has a row that matches the criteria. What am I missing? Thanks! (Googled and Super Searched) Works:
Doesn't work:
Returns error:
From the DBI doc (but not sure if it applies here) If called in a scalar context for a statement handle that has more than one column, it is undefined whether the driver will return the value of the first column or the last. So don't do that. Also, in a scalar context, an undef is returned if there are no more rows or if an error occurred. That undef can't be distinguished from an undef returned because the first field value was NULL. For these reasons you should exercise some caution if you use selectrow_array in a scalar context. —Brad "The important work of moving the world forward does not wait to be done by perfect men." George Eliot
Back to
Seekers of Perl Wisdom
|
|