GodsDev/Backyard/BackyardMysqli.php
public function query($sql, $ERROR_LOG_OUTPUT = true)
    {
        //111010 - function is called even before error_log is initialized, therefore it is necessary to mute my_error_log, hence call make_mysql_query($sql,false); 160625 - is it still necessary?
        if ($ERROR_LOG_OUTPUT) {
            $this->BackyardError->log(5, "Start of query {$sql}", array(11));
        }
        if (empty($sql) || !is_string($sql)) {
            if ($ERROR_LOG_OUTPUT) {
                $this->BackyardError->log(1, "No mysql_query_string set. End of query", array(11)); //debug
                //my_error_log("End of query", 6, 11);                
            }
            return false;
        }
        //if ($sql != "") {
        // here, we could log the query to sql.log file
        // note that, no error check is being made for this file
        //file_put_contents('/tmp/sql.log', $sql . "\n", FILE_APPEND);
        //if ($ERROR_LOG_OUTPUT) {
        //    my_error_log($sql, 5, 11);
        //}
        $result = parent::query($sql);
        if ($this->errno != 0) {
            if ($ERROR_LOG_OUTPUT) {
                $this->BackyardError->log(1, "{$this->errno} : {$this->error} /with query: {$sql}", array(11));
            }
        }
        //}
        if ($ERROR_LOG_OUTPUT) {
            $this->BackyardError->log(6, "End of query {$sql}", array(11));
        }
        return $result;
    }
public function query($sql, $ERROR_LOG_OUTPUT = true)
    {
        //111010 - function is called even before error_log is initialized, therefore it is necessary to mute my_error_log, hence call make_mysql_query($sql,false); 160625 - is it still necessary?
        if ($ERROR_LOG_OUTPUT) {
            $this->BackyardError->log(5, "Start of query {$sql}", array(11));
        }
        if (empty($sql) || !is_string($sql)) {
            if ($ERROR_LOG_OUTPUT) {
                $this->BackyardError->log(1, "No mysql_query_string set. End of query", array(11)); //debug
                //my_error_log("End of query", 6, 11);                
            }
            return false;
        }
        //if ($sql != "") {
        // here, we could log the query to sql.log file
        // note that, no error check is being made for this file
        //file_put_contents('/tmp/sql.log', $sql . "\n", FILE_APPEND);
        //if ($ERROR_LOG_OUTPUT) {
        //    my_error_log($sql, 5, 11);
        //}
        $result = parent::query($sql);
        if ($this->errno != 0) {
            if ($ERROR_LOG_OUTPUT) {
                $this->BackyardError->log(1, "{$this->errno} : {$this->error} /with query: {$sql}", array(11));
            }
        }
        //}
        if ($ERROR_LOG_OUTPUT) {
            $this->BackyardError->log(6, "End of query {$sql}", array(11));
        }
        return $result;
    }
public function query ( $ sql , $ ERROR_LOG_OUTPUT = true ) { //111010 - function is called even before error_log is initialized, therefore it is necessary to mute my_error_log, hence call make_mysql_query($sql,false); 160625 - is it still necessary? if ( $ ERROR_LOG_OUTPUT ) { $ this -> BackyardError -> log ( 5 , "Start of query {$sql}" , array ( 11 ) ) ; } if ( empty ( $ sql ) || ! is_string ( $ sql ) ) { if ( $ ERROR_LOG_OUTPUT ) { $ this -> BackyardError -> log ( 1 , "No mysql_query_string set. End of query" , array ( 11 ) ) ; //debug //my_error_log("End of query", 6, 11);                 } return false ; } //if ($sql != "") { // here, we could log the query to sql.log file // note that, no error check is being made for this file //file_put_contents('/tmp/sql.log', $sql . "\n", FILE_APPEND); //if ($ERROR_LOG_OUTPUT) { //    my_error_log($sql, 5, 11); //} $ result = parent :: query ( $ sql ) ; if ( $ this -> errno != 0 ) { if ( $ ERROR_LOG_OUTPUT ) { $ this -> BackyardError -> log ( 1 , "{$this->errno} : {$this->error} /with query: {$sql}" , array ( 11 ) ) ; } } //} if ( $ ERROR_LOG_OUTPUT ) { $ this -> BackyardError -> log ( 6 , "End of query {$sql}" , array ( 11 ) ) ; } return $ result ; }
Query method
if everything is OK, return the mysqli_result object
that is returned from parent query method

120914, inspired by http://www.blrf.net/blog/223/code/php/extending-mysqli-class-with-example/

@param string $sql SQL to execute
@return mysqli_result Object|false
@throws DBQueryException
Query method if everything is OK return the mysqli_result object that is returned from parent query method