Hi,
I am using Net::mysql to connect with database mysql.Though sytax is correct it is 
still giving error:

Can't locate object method "new" via package "MySql" (perhaps you forgot to load 
"MySql"?) at E:\PERLTR~1\perl\VALIDA~1.PL line 10. Content-type:text/html 

My code is as follows:

#!/usr/local/bin/perl
print "Content-type:text/html\n\n";
use Net::MySql;

$DBHOST = "localhost";
$DBNAME = "SiteBuilder";
$DBUSER = "sa";
$DBPASS = "";

my $mysql=MySql->new($DBHOST, $DBNAME, $DBUSER, $DBPASS);
$mysql->query(q{SELECT sLoginId,sFirstName,sLastName FROM userdetail});

my $record_set = $mysql->create_record_iterator;
  while (my $record = $record_set->each) {
      printf "First column: %s Next column: %s\n",
          $record->[0], $record->[1],$record->[2];
  }

$mysql->close;

I have tried other modules also like DBI,DBD but still I am getting same error.What 
may be the reason .I have installed these modules through ppm .Can anybody help me?
Thanks in advance !
Pankaj.

Reply via email to