コード例 #1
0
 public function setUp()
 {
     $connDetails = array('host' => 'localhost', 'dbname' => 'potatorm', 'user' => 'andela', 'pass' => 'andela');
     DbQuerries::connect($connDetails);
     Model::setTableName("cars");
     DbSettingTest::createTable(Model::getTableName());
 }
コード例 #2
0
 public static function dropTable($tableName)
 {
     $connDetails = array('host' => 'localhost', 'dbname' => 'potatorm', 'user' => 'andela', 'pass' => 'andela');
     $connect = DbQuerries::connect($connDetails);
     try {
         $connect->exec("DROP TABLE IF EXISTS {$tableName}");
     } catch (Exception $e) {
         echo $e->getMessage();
     }
 }