PDO drop table Function drop a table from database operation using GOModel

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

  
                                $GOModel = new GOModel(); //create object of the GOModel class
                                $GOModel->connect("localhost", "root", "", "database");//connect to database
                                /* Get all tables function */
                               $GOModel->dropTable("order_meta");           
                            

More Examples

 
                                //Example 1 - with column fetch mode
                                if($GOModel->dropTable("tablename"))
                                    echo "table dropped";;
                            

Result/Output

Return true if table dropped successfully

Debug

Option Details Example
$GOModel->getLastQuery(); Return last query executed DROP TABLE `tablename`
print_r($GOModel->error) Print errors (if any)