Connecting to a mySQL database - Using PERL
Does ANYONE know how to connect to a mySQL database using PERL?
----------
Dynamic Internet Solutions : http://www.dids.com
UNIX and Windows NT Hosting
Does ANYONE know how to connect to a mySQL database using PERL?
----------
Dynamic Internet Solutions : http://www.dids.com
UNIX and Windows NT Hosting
Rob Pengelly posted this at 03:24 — 17th October 1999.
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]]
http://www.thehungersite.com - http://www.therainforestsite.com
http://www.ratemymullet.com - Beauty is only mullet deep.
Anonymous posted this at 03:50 — 17th October 1999.
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.