The sql_drop_table()
function deletes an SQL table from the database. It returns true
if successful, and false
if not.
It accepts 4 parameters:
-
$table
is the name of the table, -
$exist
is used to request verification of the table’s existence for the deletion (which translates into addingIF EXISTS
to the SQL command). By default,''
, it passestrue
to confirm the table is there before trying to delete it, -
$serveur
, -
$option
.
This sql_drop_table()
function is used as shown below:
sql_drop_table('table');
sql_drop_table('table', true);