in reply to Re: Perl Mysql
in thread Perl Mysql
Connecting to a database:
To drop a table:my $database = DBI->connect("DBI:mysql:database_name,'user','pw') or die "Could not connect to database: " . DBI->errstr;
You should really read the documentation on DBI. It's much more complete than this. But this should get you started.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();
Hope this helps!
MrCromeDome
|
|---|