createdb Back | Forward | Home

'Language Reference'

User Functions

Database Functions
  • showdbs

  • createdb

  • dropdb

  • renamedb

  • isLocked

  • lockdb

  • unlockdb

  • selectdb

  • db_exists


  • Data Manipulation Functions

    Table Functions

    Error Handling Functions

    << Last Section ( showdbs ) createdb Next Section ( dropdb ) >>
    Usage void createdb ( array( 'db' => $db ) )
    Purpose To create a new txtSQL database inside the current working directory
    Availability txtSQL >= 2.0.0 Beta

    This function will create a new database inside of the current working directory, as long as it does not already exists.

    Note- This function will return false if the database already exists
    Caveat- In windows, filenames are not case-sensative, so 'DBNAME' is the same as 'dbname', which is why it will issue an error if you try to create a database 'test', when 'TEST' exists.

    Example 8: createdb() Copy to Clipboard
    <?php
    // txtSQL created a new database named testDatabase
    $sql->createdb(array('db' => 'testDatabase')) or die('Error creating txtSQL DB, txtSQL said: '.$sql->get_last_error());
    ?>

    User-Contributed Comments for:
    createdb()
    No comments found;