Need Perl Help

Namecheap AuctionsNamecheap Auctions
NamecheapNamecheap
Namecheap AuctionsNamecheap Auctions
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

A browser tab with a favicon next to the page title
Search members
You can now search for members by name, company, location and more. Open the search at the top of any page and choose Members. You will...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back