my $database = DBI->connect("DBI:mysql:database_name,'user','pw')
or die "Could not connect to database: " . DBI->errstr;
To drop a table:my $script = "DROP TABLE your_tablename ";
my $sql = $database->prepare_cached($script)
|| die "Couldn't prepare SQL: " . $database->errstr;
$sql->execute()
|| die "Can't execute SQL: " . $database->errstr;
$sql->finish();
You should really read the documentation on DBI. It's much more complete than this. But this should get you started.
Hope this helps!
MrCromeDome |