I'm pretty new to Perl (and mysql for that matter) what I want to do is create a Perl script that does web data mining and inserts it into a mysql database.
I have Perl code that goes to the website using Simple::LWP and parses the data into a single variable that contains a comma-seperated row of data from the website.
I want a Perl statement that inserts the variable called $content into a mysql database.
The code that I have now is as follows:
my $dbh=DBI->connect("DBI:mysql:dbname:localhost:root");
$dbh->do(INSERT INTO table VALUES (?),$content);
$dbh->disconnect();
Obviously, this isn't working, but I'm not sure if I'm going about it all wrong. PLease help. Thanks in advance
I have Perl code that goes to the website using Simple::LWP and parses the data into a single variable that contains a comma-seperated row of data from the website.
I want a Perl statement that inserts the variable called $content into a mysql database.
The code that I have now is as follows:
my $dbh=DBI->connect("DBI:mysql:dbname:localhost:root");
$dbh->do(INSERT INTO table VALUES (?),$content);
$dbh->disconnect();
Obviously, this isn't working, but I'm not sure if I'm going about it all wrong. PLease help. Thanks in advance