Runs a query and returns a flat array containing the values of
one row.

@param string $sql SQL to execute

@return array $row result row
516437
public function GetRow($sql, $aValues=array()) {
		$arr = $this->GetAll($sql, $aValues);
		return array_shift($arr);
	}
829512
function fetch_arrays($sql)
    {
        $rs   = $this->query($sql);
        $data = [];
        while (true == ($row = $rs->fetch_assoc())) {
            $data[] = $row;
        }
        $rs->free();
        return $data;
    }
894618
final public function query (string $sql)
	{
		static::$lastQuery 	= $sql;
		$result 			= mysqli_query($this->connection, $sql);
		$this->confirmQuery($result);
		return $result;
	}
761022
protected function query ( $sql )
	{
		$sql = $this->sql_printf(func_get_args());
		try
		{
			$this->lastaffectedrows = $this->conn->exec($sql);
			if ($this->lastaffectedrows === FALSE) {
				$this->sql_errcheck($sql);
			}
		}
		catch (PDOException $e) 
		{
			$this->sql_errcheck($sql);
		}
	}
1173253
public function query($sql) {
        $sql = $this->translateQuery($sql);
        return $this->getConnector()->query($sql);
    }
248817
protected function getOrderBySql(array $sql): array
    {
        if (empty($this->orderBy)) {
            return $sql;
        }
        $sql[] = 'ORDER BY ' . implode(', ', $this->quoter->quoteByFields($this->orderBy));

        return $sql;
    }
422532
public static function insertBySql($sql)
    {
        if (is_array($sql)) {
            $bind = $sql;
            unset($bind[0]);
            $sql = $sql[0];
        } else {
            $bind = [];
        }

        $model = new static;

        $table = $model->getSource($bind);
        return $model->getConnection($bind)->insertBySql('INSERT' . " INTO [$table] " . $sql, $bind);
    }
44267
public function queryValue(string $sql, string $column, $default = null)
    {
        $result = $default;
        if ($row = $this->query($sql)->fetch(PDO::FETCH_ASSOC)) {
            $result = $row[$column];
        }

        return $result;
    }
1093589
public function exec($sql)
    {
        $return = $this->connection->exec($sql);

        if ($this->useDebug) {
            $this->log($sql);
            $this->setLastExecutedQuery($sql);
            $this->incrementQueryCount();
        }

        return $return;
    }
760090
public static function multi_query($sql) {
        self::init();
        self::connect();
        mysqli_report(MYSQLI_REPORT_STRICT);
        try {
            $query = self::connect()->multi_query($sql);
        } catch(mysqli_sql_exception $e) {
            throw $e;
        }
        return ['result' => $query, 'link' => self::$_db];
    }
1204547
public function getRow($sql, $params = null)
    {
        $stmt = $this->execute($sql, $params);

        return $stmt->fetch(PDO::FETCH_ASSOC);
    }
70505
public function getArray($sql = null, $parameters = array()) {
		$this->execute($sql);
		$result = array();
		while (!!$objs = mysqli_fetch_assoc($this->result) ) {
			$result[] = $objs;
		}
		return $result;
	}
481564
final public static function findBySql (string $sql) : array
	{
        $dbObject 		= Database::getInstance();
		$resultSet 		= $dbObject->query($sql);
		$objectArray 	= [];
		while ($row = Database::fetchAssoc($resultSet))
		{
			$objectArray[] = static::instantiate($row);
		}
		return $objectArray;
	}
1215317
public function query($sql)
    {
        // get start time of sql execution
        $start = $this->_firebug->timer();
        // execute sql
        $records = $this->_pdo->query($sql);
        // record sql statement
        if ($this->_firebug->isEnabled()) {
            $trace = debug_backtrace();
            $this->_recordSqlStatement($start, $sql, $trace);
        }

        return $records;
    }
500695
public function fetch_arrays($sql)
    {
        $result = $this->db->query($sql);
        $array  = null;
        while (true == ($row = $result->fetchArray(SQLITE3_ASSOC))) {
            $array[] = $row;
        }
        $GLOBALS['__$DB_QUERY_COUNT']++;

        $result->finalize();
        return $array;
    }
197784
public function exec($sql)
    {
        $result = $this->pdo->exec($sql);
        $this->executed[] = $sql;
        return $result;
    }
1336870
protected function getGroupBySql(array $sql): array
    {
        if (empty($this->groupBy)) {
            return $sql;
        }
        $sql[] = 'GROUP BY ' . implode(', ', $this->quoter->quoteByFields($this->groupBy));

        return $sql;
    }