in reply to Perl Mysql Null Recordset
dws's solution works great if you only need to check if a user exists or not (although I'd use fetch() and $rs->[0] instead of fetchall_arrayref() and $rs->[0]->[0]). If you want to check if the user exists or not, and do something with the record if he does, try the following:
$rs1 = $db1->prepare("SELECT ..."); $rs1->execute(...); unless ($row = $rs1->fetch())) { die("User does not exist\n"); } ... check supplied password against the one in $row ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl Mysql Null Recordset
by JoeJaz (Monk) on Nov 16, 2004 at 22:06 UTC |