Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
... my %info = (); my $hashref = (); my $dbh = connectstuffhere->connect_mysql(); # this its all set, conne +ction works, not the issue here my $sth = $dbh->prepare("select * from mytable where lastn = ? and use +rname = ? ") or &die("Can't select: ",$dbh->errmsg); $sth->execute($lname,$username); $hashref = $sth->fetchrow_hashref; %info = {$hashref}; if (!(scalar %info)) { # what does this mean? &dead("Username '$username' is not here."); } if ($info{username} eq "") { # but there is a username value in the da +tabase and the field its called username &dead("No username found!"); } ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help on fetchrow_hashref!
by kennethk (Abbot) on Nov 09, 2010 at 16:31 UTC | |
by Anonymous Monk on Nov 09, 2010 at 19:01 UTC | |
by Corion (Patriarch) on Nov 09, 2010 at 19:11 UTC | |
by Anonymous Monk on Nov 09, 2010 at 19:30 UTC | |
by Corion (Patriarch) on Nov 09, 2010 at 20:29 UTC | |
| |
|
Re: Help on fetchrow_hashref!
by zentara (Cardinal) on Nov 09, 2010 at 16:29 UTC | |
|
Re: Help on fetchrow_hashref!
by Tux (Canon) on Nov 09, 2010 at 17:00 UTC |