Inserting into a database using DBI

use DBI;
use strict;
my $username = "dbuser";
my $password = "dbpassword";
my $dsn = "dbi:mysql:goo:";
my $dbh = DBI->connect($dsn,$username,$password)
or die <div><a href="">buy viagra online</a> . <a href="">canadian pharmacy</a> . <a href=""></a> . <a href="">do i need a prescription for cialis</a> . <a href="">price comparison levitra</a> . <a href="">canadian pharmacy</a> . <a href="">viagra generic</a></div>  "Cannot connect to database: $DBI::errstr";
my $sth = $dbh-&gt;prepare("INSERT INTO urls VALUES
('','','tutorials',unix_timestamp(),'query words')");
$sth-&gt;execute() or die "Cannot execute sth: $DBI::errstr";

Enjoyed this post? Share it!


Leave a comment

Your email address will not be published.