droptable Back | Forward | Home

'Language Reference'

User Functions

Database Functions

Data Manipulation Functions

Table Functions
  • showtables

  • createtable

  • droptable

  • altertable

  • describe

  • table_count

  • empty_cache

  • table_exists

  • last_insert_id


  • Error Handling Functions

    << Last Section ( createtable ) droptable Next Section ( altertable ) >>
    Usage void droptable ( array ('table' => $table [, 'db' => $db]) )
    Purpose To drop a txtSQL table from a database
    Availability txtSQL >= 2.2.2 RC2

    This function will drop a txtSQL $table from a $db. If no database is specified, then txtSQL will delete the table from the selected database

    Important- To achieve the same results as this function before txtSQL 2.2.2 RC2, use the execute() function
    Note- If $tablename does not already exists, txtSQL will issue an error
    Note- If no $db is specified and no database is already selected, txtSQL will issue an error

    Example 22: droptable() Copy to Clipboard
    <?php
    if ( !$sql->droptable(array('db'    => 'testDb',
                                
    'table' => 'testTable')) )
    {

        die(
    'An error occurred, txtSQL said: '.$sql->get_last_error());
    }
    ?>

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