in reply to Re: mysql
in thread mysql.pm not found

here is the code
#!/usr/bin/perl -w use Mysql; $Host = "Localhost"; $Database = "test"; $User = "user"; $Passwd = ""; $dbh = Mysql->connect($Host, $Database, $User, $Passwd); $sql_statement = "select * from TEST"; $sth = $dbh->query($sql_statement); if (!defined $sth) { warn($dbh->errmsg); } while ( @row = $sth->fetchrow_array ) { print "$row[0]\t$row[1]\n"; } exit 0;

Replies are listed 'Best First'.
Re: Re: Re: mysql
by robartes (Priest) on Apr 10, 2003 at 08:06 UTC
    Ah, in that case you probably do not have the module installed. Try installing it with CPAN.pm:
    $ perl -MCPAN -e 'install Bundle::DBD::mysql'
    If that works (if it's the first time you use CPAN.pm, you will have to answer some configuration questions), you should be set to go. But, as said, do consider switching to DBI (which is installed with the bundle).

    CU
    Robartes-