Your web server usually executes as a different user and with a different environment as you on the command line.
In your case it could be that $dbh is undef because the web server couldn't connect to the database. So better check those return values, especially if you turned off any error-raising as you seem to have done
PS: Please 'use warnings' at a minimum, 'use strict' is also advisable
In reply to Re: Output of CGI with DBI
by jethro
in thread Output of CGI with DBI
by brp4h
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |