spewn
Programmer
- May 7, 2001
- 1,034
i have created a database using cpanel/mysql called gtName_test with a table called candy...
***
#!/usr/bin/perl -w
use strict;
use CGI qw
standard);
use DBI;
my $dbh = DBI->connect('dbi:mysql:gtName_test','','');
*** etc ***
although the script doesn't throw any error, i use the following test:
**
my $sql = "select name from candy";
my $sth = $dbh->prepare($sql);
$sth->execute || die "Could not execute SQL statement ... maybe invalid?";
while (@row=$sth->fetchrow_array)
{ print "@row\n" }
**
not even the error for "Could not execute..." comes up which tells me that it's not even getting to that point.
i have the correct table, 'candy', and i have a name field...
i'm following stuff for perl/mysql online but none of it works.
help please?
- g
***
#!/usr/bin/perl -w
use strict;
use CGI qw
use DBI;
my $dbh = DBI->connect('dbi:mysql:gtName_test','','');
*** etc ***
although the script doesn't throw any error, i use the following test:
**
my $sql = "select name from candy";
my $sth = $dbh->prepare($sql);
$sth->execute || die "Could not execute SQL statement ... maybe invalid?";
while (@row=$sth->fetchrow_array)
{ print "@row\n" }
**
not even the error for "Could not execute..." comes up which tells me that it's not even getting to that point.
i have the correct table, 'candy', and i have a name field...
i'm following stuff for perl/mysql online but none of it works.
help please?
- g