I am trying to use a database for logon information, but what if my query for the user fails how do I catch the error so I can send a message letting them know they dont have the right user name? I also dont want the query to end the program?
my($user) = $q->param('user');
my($pass ) = $q->param('pass');
&con;#connects to database
$sth=$dbh->prepare (qq{
SELECT pass FROM userdata WHERE user=?
} );
$sth->execute ($user);
$sth->bind_columns (\$pass);
$sth->fetch;
$sth->finish;
&dis#disconnects from database;
ty in advance
my($user) = $q->param('user');
my($pass ) = $q->param('pass');
&con;#connects to database
$sth=$dbh->prepare (qq{
SELECT pass FROM userdata WHERE user=?
} );
$sth->execute ($user);
$sth->bind_columns (\$pass);
$sth->fetch;
$sth->finish;
&dis#disconnects from database;
ty in advance