<createdb $db [$syspass [$publicpass [$methods]]]>
createdb function creates a new database whose path is
given by $db. The passwords for
PUBLIC are given as arguments (default empty if not specified).
The optional $methods argument controls the method(s) used to create the database's locking mechanism. It is the same format as the <sqlcp createlocksmethods> value (here). This parameter was added in version 7.00.1368636508 20130515.
Note that unlike the
DB directive, which affects all other
SQL commands, the database for
createdb is specified at run
createdb can be used in an administrative script
to create new databases.
createdb returns "
Creating database succeeded" on
success, or "
Creating database failed" or nothing on error.
<createdb "/usr/local/mydb" "Klaatu!" "">
createdb function was added Oct. 10 1996. The $methods parameter was added in version 7.00.1368636508 20130515,
when the $syspass and $publicpass parameters became
optional as well; previous versions also required $syspass to be
at least 6 characters and contain punctuation.
The path given to
createdb is absolute, not relative to the
HTML documents tree, and is not checked. It is up to the programmer
to verify the path before calling
createdb, e.g. to check
whether the Web user is permitted to access the dir, etc.