Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Answer: What modules do I need to connect Perl to MySQL?

by Anonymous Monk
on Oct 17, 2003 at 16:11 UTC ( #300057=categorized answer: print w/replies, xml ) Need Help??

Q&A > database programming > What modules do I need to connect Perl to MySQL? - Answer contributed by Anonymous Monk

It's simple, select 'Mysql':
#!/usr/bin/perl use Mysql; $DBHOST = "localhost"; $DBNAME = "dbname"; $DBUSER = "user"; $DBPASS = "password"; $DB = Mysql->connect($DBHOST, $DBNAME, $DBUSER, $DBPASS); my $qry = $DB->query( qq~SELECT * FROM cds~ ); while( @emps = $qry->fetchrow) { print qq~ $emps[0]<br> ~; }

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2017-08-18 02:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (294 votes). Check out past polls.

    Notices?