NameSilo

Need Perl Help

Spaceship Spaceship
Watch
Impact
0
I have done some simple postgre database work in perl on a local machine and now I want to do an online database. I have set up the postgre db with several tables and I am able to execute SQL commands from phpPgadmin but I am trouble getting perl scripts to "execute". My script is connecting to db, It fails as at "$sth->execute;" Could it be a user privlege issue? Any help would be apreciated. My code..

use DBI;
my $dbh = DBI->connect('dbi: Pg:dbname=db_name;host=localhost', 'user', 'pass');
$sth = $dbh->prepare("SELECT * FROM users");
$sth->execute; # this is where it fails #
while ( @row = $sth->fetchrow()){
$ct++;
}
print "ct = $ct";
exit;

I am trying to at least get a hit by counting a how many times it loops through the array.
Any help to this newbee would be great!!
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
.US domains.US domains
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99
Appraise.net

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back