Home    Back    Forward    Refresh    txtSQL Homepage

droptable
Purpose: To drop a txtSQL table from a database
txtSQL >= 2.2.2 RC2
void droptable ( array ('table' => $table [, 'db' => $db]) )

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 Comments - droptable
No comments posted yet;
Last Page Next Page

'Language Reference'

User Functions

Database Functions

Data Manipulation Functions

Table Functions
  • showtables
  • createtable
  • droptable
  • altertable
  • describe
  • table_count
  • emptyCache
  • table_exists
  • last_insert_id

    Error Handling Functions

    SQL Syntax

  • [ txtSQL Documentation powered by txtSQL | 6 SQL Queries ]