Пример #1
0
 /**
  * 写操作,插入或者更新
  * @param string $sql
  * @return int $result
  */
 public function execute($sql)
 {
     try {
         $result = $this->_dbInstance->exec($sql);
         if (!$result) {
             throw new Exception("<br/>errorSQL:<b style='color:f00'>{$sql}</b><br/>\n");
         }
         return $result;
     } catch (Exception $e) {
         exit("<br/>error<br/>" . $e->getMessage());
     }
     return FALSE;
 }
Пример #2
0
 public static function tearDownAfterClass()
 {
     echo "\n";
     foreach (static::$models as $model) {
         call_user_func(array('Fujicat\\Sardine\\' . $model, 'drop'));
         echo "Drop table '" . call_user_func(array('Fujicat\\Sardine\\' . $model, 'table_name')) . "'.\n";
     }
     Model_Pdo::disconnect();
     echo "Closed database connection.";
     echo "\n###########################################\n# Finished Test Case: PdoTest...\n###########################################\n";
 }