CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Can't locate DBD/Mysql.pm in @NIC

 



jayvirk
New User

Oct 5, 2014, 5:26 PM

Post #1 of 2 (3763 views)
Can't locate DBD/Mysql.pm in @NIC Can't Post

I have installed latest version of Perl from ActiveState version 5.18.2.1802 successfully. I am using Mysql database at back end in windows 8 environment. Wrote down the following code


Code
#!/usr/local/bin/perl 
use CGI;
use DBI;
$cgiObj = CGI->new;
print $cgiObj->header('text/html');

$params = 'DBI:mysql:world:localhost';
$user = 'root';
$pass = 'XXXXXX!';

$conn = DBI->connect($params, $user, $pass);
$sql='select * from city';
$query =$conn->prepare($sql);
$query->execute;
while(@row=$query->fetchrow_array)
{
print "ID: $row[0], Name: $row[1]<br>\n";
}


Please some one give me guidence how to solve this problem.


Laurent_R
Veteran / Moderator

Oct 6, 2014, 1:08 PM

Post #2 of 2 (3702 views)
Re: [jayvirk] Can't locate DBD/Mysql.pm in @NIC [In reply to] Can't Post

The message is quite clear: you need to install the Mysql module.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives