in reply to compare two values in perl

Once you execute, you still have to fetch your result set. So the following should work better for you:
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.

Replies are listed 'Best First'.
Re^2: compare two values in perl
by Anonymous Monk on Dec 10, 2006 at 01:28 UTC
    Thanks very much for all the advice, it was a great help i now have it working, thanks again