Description
Drop table function allows to drop a table from database by specifying the table name
Function Defination
void function dropTable($dbTableName);
Parameters Details
| Details | Type | Example |
|---|---|---|
| $dbTableName - table name to be dropped from database | string | e.g. "emptable" |
Examples
$pdomodel = new PDOModel(); //create object of the PDOModel class
$pdomodel->connect("localhost", "root", "", "pdocrud");//connect to database
/* Get all tables function */
$pdomodel->dropTable("order_meta");
More Examples
//Example 1 - with column fetch mode
if($pdomodel->dropTable("tablename"))
echo "table dropped";;
Result/Output
Return true if table dropped successfully
Debug
| Option | Details | Example |
|---|---|---|
| $pdomodel->getLastQuery(); | Return last query executed | DROP TABLE `tablename` |
| print_r($pdomodel->error) | Print errors (if any) |