public function BackupDatabase($database) { $connection = parent::getConnection(); // try{ // $backup = $connection->prepare('mysqldump -u root -p 123456 '. $database .' > ' . HOME . 'archives/backup.sql'); // $backup->execute(); // return true; // }catch(Exception $e){ // return false; // $this->result = $e; // } return system('mysqldump -u root -p 123456 ' . $database . ' > ' . HOME . 'archives/backup.sql'); }
public static function query($sql, $link_identifier = NULL) { if (empty($sql)) { throw new MyException('empty sql'); //return null; } if (empty($link_identifier)) { $link_identifier = Conn::getConnection(); } // var_dump($sql); // var_dump($link_identifier); $result = mysql_query($sql, $link_identifier); if (!$result) { throw new MyException("Fail query: ({$sql}) mysql_error: " . mysql_error()); //return null; return NULL; } return $result; }
/** * PRIVATE METHODS - Métodos privados para uso interno da classe * */ private function getCon() { $this->connection = parent::getConnection(); $this->update = $this->connection->prepare($this->update); }
/** * PRIVATE METHODS = Métodos privados para uso interno da classe * */ private function getCon() { $this->connection = parent::getConnection(); $this->delete = $this->connection->prepare($this->query); }
/** * PRIVATE METHODS = Métodos privados para uso interno da classe * */ private function getCon() { $this->connection = parent::getConnection(); $this->read = $this->connection->prepare($this->query); $this->read->setFetchMode(PDO::FETCH_ASSOC); }