/**
  * drop an existing database
  *
  * @param object    $dbs        database object that is extended by this class
  * @param string $name name of the database that should be dropped
  * @return mixed MDB_OK on success, a MDB error on failure
  * @access public
  */
 function dropDatabase(&$db, $name)
 {
     if (MDB::isError($result = $db->connect())) {
         return $result;
     }
     if (!@fbsql_stop_db($name, $db->connection)) {
         return $db->fbsqlRaiseError();
     }
     if (!@fbsql_drop_db($name, $db->connection)) {
         return $db->fbsqlRaiseError();
     }
     return $db->disconnect();
 }
Esempio n. 2
0
 /**
  * drop an existing database
  *
  * @param string $name name of the database that should be dropped
  * @return mixed MDB2_OK on success, a MDB2 error on failure
  * @access public
  */
 function dropDatabase($name)
 {
     $db =& $GLOBALS['_MDB2_databases'][$this->db_index];
     if (MDB2::isError($result = $db->connect())) {
         return $result;
     }
     if (!@fbsql_stop_db($name, $db->connection)) {
         return $db->raiseError();
     }
     if (!@fbsql_drop_db($name, $db->connection)) {
         return $db->raiseError();
     }
     return $db->disconnect();
 }