Anyone has any experience of trapping error using DBI-mySQL. The following code is not trapping the error. it is producing system generated error.
$memberId='2a'; my($memberId)=@_; my($sql)= " select member_id from members where member_id != " . $memberId; my $sth = $dbh->prepare($sql) || die " Error " . $DBI::errstr; eval { $sth->execute() } ; print "Error while calculating" : $@") if $@; while (my $ref = $sth->fetchrow_hashref()) { ... it gives the output which does not have my message "Error while cqalculating .." [Tue Oct 1 05:53:27 2002] C:\Inetpub\intranet\dev\cgi-bin\Score.pl: DBD::mysql: :st execute failed: Unknown column '2a' in 'where clause' at C:\Inetpub\intranet \dev\cgi-bin\Score.pl line 25. Content-type: text/html <H1>Software error:</H1> <PRE> Error Unknown column '2a' in 'where clause' at C:\Inetpub\intranet\dev\cgi -bin\Score.pl line 25. </PRE> <P> For help, please send mail to this site's webmaster, giving this error message and the time and date of the error. [Tue Oct 1 05:53:27 2002] C:\Inetpub\intranet\dev\cgi-bin\Score.pl: Error Unkn own column '2a' in 'where clause' at C:\Inetpub\intranet\dev\cgi-bin\Score.pl li ne 25. --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php