Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: How to use MySQL from CGI?

by matthewb (Curate)
on Feb 04, 2004 at 15:29 UTC ( [id://326590]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to How to use MySQL from CGI?

Can someone just give me a snippet on how to connect to a MySQL db from a website?
#!/usr/bin/perl -T use warnings FATAL => 'all'; use strict; use DBI; use CGI; my( $dsn, $username, $password ) = qw( you tell me ); my $dbh = DBI->connect( $dsn, $username, $password ) or die DBI::errstr; my $q = CGI->new; print $q->header, $q->h1( "Looks like we connected to $dsn!" ); exit;

You have much reading to do.

MB

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://326590]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.