On Sun, 2 Nov 1997 [EMAIL PROTECTED] wrote:
>
> >
> >Hi,
> >
> >Im trying to connect a perl program to a mysql database on my home computer
> >running win 2k. I can connect, but i have no idea of how to extract the
> >information out of tables using perl. I have a book about SQL, but it never
> >mentions programming or perl. If anyone could point me to a good tutorial,
> >or give me a few pointers I would be greatly appreciative.
> >
> >
Your best bet would be to start with the documentation for the DBI module
in the first place.
A typical session might be :
use DBI;
my $database = DBI->connect('dbi:MySQL:<whatever>'); # whatever works
my $cursor = $database->prepare('select * from sometable');
# where sometable is a table in your database
$cursor->execute();
while ( $cursor->fetch() )
{
print "@{$_}\n";
}
HTH
/J\