Name
Msql::createdb
Synopsis
$result = $db->createdb($database);
Msql::createdb
takes as its argument the name of a
database to create. It then sends the creation request to the mSQL
server. The command is sent as the same user running the CGI program.
Thus, to work in a CGI program, the program must be run as a user
with the right to create a new database. The function returns -1 on
failure and
on success.
Example
use Msql; my $db = Msql->connect; my $my_new_database = 'mynewdata'; my $result = $db->createdb($my_new_database); die "Database was not created!" if $result == -1; print "$my_new_database has been created.\n";
Get MySQL and mSQL now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.