sanPerl has asked for the wisdom of the Perl Monks concerning the following question:
I am getting following error#!/usr/bin/perl -wT print "Content-type: text/html \n\n"; use DBI; # Connect To Database $database = "a_qtest"; $username = "a_read"; $password = "password"; $hostname = "localhost"; $db = DBI->connect("DBI:mysql:$database:$hostname", $username, $passwo +rd); if(!$db = DBI->connect("DBI:mysql:$database:$hostname", $username, $pa +ssword)) print "Connection unsuccessful. Please check your login credentia +ls. ".$DBI::errstr; # Execute a Query $query = $db->prepare("SELECT * FROM mytable"); $query->execute; # How many rows in result? $numrows = $query->rows; # Display Results while (@array = $query->fetchrow_array) { ($field1, $field2, $field3) = @array; print "field1 = $field1, field2 = $field2, field3 = $field3 "; } # Cleaning Up $query->finish; $db->disconnect; exit(0);
I would be grateful if anyone provides me any clues.Internal Server Error The server encountered an internal error or misconfiguration and was u +nable to complete your request. Please contact the server administrator, webmaster@myurl.com and infor +m them of the time the error occurred, and anything you might have do +ne that may have caused the error. More information about this error may be available in the server error + log. Additionally, a 404 Not Found error was encountered while trying to us +e an ErrorDocument to handle the request. ---------------------------------------------------------------------- +---------- Apache/2.2.13 Server at www.myurl.com Port 80
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Basic error in CGI script
by afoken (Chancellor) on Dec 09, 2009 at 19:47 UTC | |
|
Re: Basic error in CGI script
by ww (Archbishop) on Dec 09, 2009 at 19:45 UTC | |
|
Re: Basic error in CGI script
by vitoco (Hermit) on Dec 09, 2009 at 21:51 UTC |