Iam new to DBI ,
 
When I try to connect to a database using DBI the perl Interpreter gives following 
error massage
 
 
install_driver(mysql) failed: DBD::mysql object version 2.0400 does not match 
bootstrap parameter 2.0416 at C:/Perl/lib/DynaLoader.pm line 225.
Compilation failed in require at (eval 1) line 3.

what is the problem and how can i fix it
__________________________________________________________________________________________________________________________---
 
#This is the program I tried


    #!/usr/bin/perl

    use strict;
    use DBI();

    # Connect to the database.
    my $dbh = DBI->connect("DBI:mysql:database=mysql;host=localhost",
                           "lrmk", "lrmklrmk",
                           {'RaiseError' => 1});


    my $sth = $dbh->prepare("SELECT * FROM users");
    $sth->execute();
    while (my $ref = $sth->fetchrow_hashref()) {
      print "Found a row: name = $ref->{'name'}\n";
    }
    $sth->finish();

    # Disconnect from the database.
    $dbh->disconnect();


____________________________________________________________________________________________________________________________
 

Reply via email to