NameSilo

Need Perl Help

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
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.
GoDaddyGoDaddy
Dynadot — .com TransferDynadot — .com Transfer
Truehost — .com domains from $4.99, hosting includedTruehost — .com domains from $4.99, hosting included

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back