controllers/commands/Database.php
public function cmdSqlDatabase()
    {
        $sql = $this->getParam(0);

        if (empty($sql)) {
            $this->errorAndExit($this->text('Invalid command'));
        }

        $result = $this->db->query($sql);

        if ($this->getParam('fetch')) {
            $result = $result->fetchAll(\PDO::FETCH_ASSOC);
            $this->outputFormat($result);
            $this->outputFormatTableDatabase($result);
        }

        $this->output();
    }
public function cmdSqlDatabase()
    {
        $sql = $this->getParam(0);

        if (empty($sql)) {
            $this->errorAndExit($this->text('Invalid command'));
        }

        $result = $this->db->query($sql);

        if ($this->getParam('fetch')) {
            $result = $result->fetchAll(\PDO::FETCH_ASSOC);
            $this->outputFormat($result);
            $this->outputFormatTableDatabase($result);
        }

        $this->output();
    }
public function cmdSqlDatabase ( ) { $ sql = $ this -> getParam ( 0 ) ; if ( empty ( $ sql ) ) { $ this -> errorAndExit ( $ this -> text ( 'Invalid command' ) ) ; } $ result = $ this -> db -> query ( $ sql ) ; if ( $ this -> getParam ( 'fetch' ) ) { $ result = $ result -> fetchAll ( \ PDO :: FETCH_ASSOC ) ; $ this -> outputFormat ( $ result ) ; $ this -> outputFormatTableDatabase ( $ result ) ; } $ this -> output ( ) ; }
Callback for "database-sql" command
Callback for database - sql command