Connecting to a mySQL database - Using PERL

They have: 5,633 posts

Joined: Jan 1970

Does ANYONE know how to connect to a mySQL database using PERL?

----------
Dynamic Internet Solutions : http://www.dids.com
UNIX and Windows NT Hosting

They have: 850 posts

Joined: Jul 1999

This should work (someone correct me if i'm wrong!)

use Mysql;

$database="databasename";
$user="user";
$password="password";
$tablename= "tablename";

$dbh = Mysql->connect(undef, $database, $user, $password);

#Than to insert somthing

$insert_statement ="$dbh->prepare(qq(insert into $tablename (name,e ail) values('$name,'$email')))";
#Execute the sql statement
$sth = $dbh->execute;
$sth->finish;
mysql_close()

I beleive thats the code.
(Damn the text box is TOO small is the new version of big talker.

----------
[red][Rob P][/red]
[[email protected]]--[[icq]16560402[/icq]]

They have: 5,633 posts

Joined: Jan 1970

I knew it was SIMPLE!!!! Thank you so much Rob! I had this HUGE script trying to login and everything and it just didn't want to go... I bugged every person I knew trying to get an answer (aside from one of our systems administrators). Again, thanks so much.

----------
Dynamic Internet Solutions : http://www.dids.com
UNIX and Windows NT Hosting

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.