my $usr = $dbh->prepare(q{SELECT user_id from user where user_id = ?} +) or die("usr prepare error: $!"); $usr->execute($user_name) or die("usr execute error: $!"); while (@row = $usr->fetchrow_array ) { if ($user_name eq $row[0]) { # Blah } }
You should also be checking the return values to ensure your statements are being handled properly.
In reply to Re: compare two values in perl
by madbombX
in thread compare two values in perl
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |