Hi,
I tried to connect to the database, when I compiled it, it replied with
"(offline mode: enter name=value pairs on standard input)" - What is
this meant?
Below is my code:
#!/usr/bin/perl -w
use strict;
use CGI;
use DBI;
my $dbh;
my $sth;
my @row;
my $form = new CGI;
print $form->header;
print "<html><body>";
print "ready to connect<p>";
my $database = "loc_data";
my $username = "mysql";
my $password = "mysql";
#open connection to Access database
$dbh = DBI->connect("DBI:mysql:$database", "$username", "$password")
or die "Couldn't connect to database: " . $dbh->errstr;
# print "connected<p>";
#construct SQL statement
##$sqlstatement = "SELECT * from tld_data";
# print "selected<p>";
#prepare and execute SQL statement
$sth = $dbh->prepare("SELECT * from tld_data") or die "Can't prepare SQL
statement: " ;
# print "prepared<p>";
$sth->execute || print "Could not execute SQL statement, maybe invalid?";
#print "<p>ready to output";
#output database results
while (@row=$sth->fetchrow_array)
{ print "@row\n<br>" }
#vprint "hello";
#close datbase
$dbh->disconnect();
$sth -> finish;
print $form->end_html;
Thanks in advance,
Connie
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
---------------------------------------------------------------------
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 <mysql-unsubscribe-##L=##[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php