Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! C:\xampp\perl\bin\perl.exe
- use DBI;
- use CGI qw(:standard);
- print header;
- # MySQL database configuration
- my $dsn = "dbi:mysql:host=localhost;";
- my $username = "root";
- my $password = '';
- # connect to MySQL database
- my $dbh = dbi->connect($dsn,"$username","$password");
- print "Connected to the MySQL database. \n \n";
- # Formulate Query
- my $sql = do ("create database As4Part2");
- #Validate the INSERT statement
- my $stmt = $dbh->prepare($sql);
- #Executing the Query
- $stmt->execute();
- #Close the connection
- $dbh->disconnect();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement