hi

i have now finally installed the mysql server and the mysql driver.

when i run the script (chmod'ed 777) below in the terminal i get this
output (which is correct):

Content-Type: text/html

one
two
Found a row: title = xterminator, format = 2lp
three



however when i run the scirpt from my browser, where i know perl works
fine with apache i only get:
one


so my question is how can i get the same output in the brower?

thanks
allan




______script____________

#!/usr/bin/perl -w
print "Content-Type: text/html\n\n";
use strict;
use DBI();
print "one\n";
my $dbh = DBI->connect("DBI:mysql:database=lps;host=localhost","", "",
{'RaiseError' => 1});
print "two\n";
my $sth = $dbh->prepare("SELECT * FROM longplayers");
$sth->execute();
while (my $ref = $sth->fetchrow_hashref()) {
        print "Found a row: title = $ref->{'title'}, format = $ref->{'format'}\n";
}
$sth->finish();
$dbh->disconnect();
print "three\n";

Reply via email to