Here is my script

#!/usr/bin/perl
#
# Cannonical Perl DBI connection to Mysql.
##############################################################################


use DBI;

$db = "test";   # your username (= login name  = account name )
$host = "127.0.0.1";    # = "localhost", the server your are on.
$user = "";             # your Database name is the same as your account name.
$pwd = "";      # Your account password


# connect to the database.


$dbh = DBI->connect( "DBI:mysql:$db:$host", $user, $pwd)
                or die "Connecting : $DBI::errstr\n ";

$sql = "SELECT * FROM users";


# executing the SQL statement.


$sth = $dbh->prepare($sql) or die "preparing: ",$dbh->errstr;
$sth->execute or die "executing: ", $dbh->errstr;

print "content-type: text/html\n\n";


# one of the functions to retrieve data from the table results 
# check perldoc DBI for more methods.


while ($row = $sth->fetchrow_hashref)           
{
        print $row->{'username'},'<BR>';        
}




The errors that i recieve

------------------------------------
Can't load 'C:/Perl/site/lib/auto/DBI/DBI.dll' for module DBI: 
load_file:&#9472;&#943;&#906; 
&#9616;&#938;&#940;&#906; &#970;&#939;&#906;&#940;&#938;&#8319; &#906;&#940; 
&#943;&#906;&#938;&#910;&#911;&#974;&#8804;&#938;&#943;&#9600; &#973; 
&#902;&#940;&#971;&#910;�&#974;&#8804;&#905;&#9612;&#906;&#973; 
&#905;&#910;&#906;&#9604;&#970;&#940; at C
lib/DynaLoader.pm line 206.
BEGIN failed--compilation aborted at C:/Perl/site/lib/DBI.pm line 255.
Compilation failed in require at remote_db_connection.pl line 7.
BEGIN failed--compilation aborted at remote_db_connection.pl line 7.
-------------------------------------------------

I have the Active Perl 5.6 build 635.

The Mysql is on my system.

I have the DBI and DBD::Mysql as well.

It seems that there is no linking :(

Reply via email to