I don't think anyone helped on this yet...

You should connect with 'RaiseError' set, that
will cause the program to fail with a message if a DBI
error is encountered.

You are not currently doing any checking on your
DBI statements.

See the DBI docs.

-----Original Message-----
From: Krung Saengpole [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 23, 2001 3:47 AM
To: [EMAIL PROTECTED]
Subject: Newbie Q. : fetchrow_array.


Hello all,

I just start to learn dbi and have a problem with it. I use dbi to
connect
to Access database and fetch the data to array 'til end of file.
But it only showed 2 lines of data and error took place. No error code
or
message shown the reason why. My code is:

use DBI;

$dbh = DBI->connect('dbi:ODBC:myDSN', '','');
$sth = $dbh->prepare("Select * From TotalLevel");
$sth->execute();
while (@data = $sth->fetchrow_array) {
  foreach (@data){
    print "$_ \t";
  }
  print "\n";
}
$sth->finish;
$dbh->disconnect;

Any help would be appreciated. Thank you in advance.

Reply via email to