fetches an associative array

@param $sql string

@return bool array
189079
public function fetch_assoc($sql)
    {

        if (empty($sql)) return false;

        $res    = $this->query($sql);
        $result = @mysql_fetch_assoc($res);
        $this->free($res);

        return $result;
    }
368018
public function getRow($sql, $params = array())
    {
        $stmt = $this->execute($sql, $params);
        return $stmt->fetch($this->fetchMode);
    }
1274756
function fetch_objects($sql)
    {
        $rs   = $this->query($sql);
        $data = null;
        while (true == ($row = $rs->fetch_object())) {
            $data[] = $row;
        }
        $rs->free();
        return $data;
    }
1294087
private function query($sql) {
		if ($sth = $this->DB->query($sql)) {
			$res = $sth->fetchAll(PDO::FETCH_COLUMN);
		} else {
			$res = false;
		}
		return $res;
	}
248817
protected function getOrderBySql(array $sql): array
    {
        if (empty($this->orderBy)) {
            return $sql;
        }
        $sql[] = 'ORDER BY ' . implode(', ', $this->quoter->quoteByFields($this->orderBy));

        return $sql;
    }
927940
public function fetch_objects($sql)
    {
        $arr = $this->fetch_arrays($sql);
        if (!empty($arr)) {
            foreach ($arr as $k => $v) {
                $arr[$k] = (object) $v;
            }
        }

        $GLOBALS['__$DB_QUERY_COUNT']++;
        return $arr;
    }
11572
protected function prepareArrayPlaceholders($sql)
    {
        if (!count($this->arrays)) {
            return $sql;
        }
        foreach ($this->arrays as $placeholder => $array) {
            if (strpos($sql, $placeholder) === false) {
                continue;
            }

            $placeholders = [];
            $cnt = count($array);
            for ($i = 0; $i < $cnt; $i++) {
                $placeholders[] = $placeholder . $i;
            }
            $sql = str_replace($placeholder, '(' . implode(', ', $placeholders) . ')', $sql);
        }

        return $sql;
    }
1356111
public function query(string $sql): ?array
    {
        $conn = $this->dbUtils->getConn();
        $sql = trim($sql);
        try {
            $res = $conn->query($sql);
            if (strpos($sql, 'SELECT') === 0) {
                return $res->fetchAll();
            }

            return null;
        } catch (\Exception $e) {
            throw new NeuralyzerException($e->getMessage());
        }
    }
143445
public function sql(string $sql, array $params = []) {
        $r = $this->model->db->query($sql, $params);
        if (!is_array($r) || 0 === count($r)) {
            return [];
        }
        return $this->model->setup($r);
    }
223963
public function findBySql($sql)
    {
        $results = [];
        $stmt = $this->resolveConnection()->prepare(trim($sql));
        $stmt->execute();
        $results = $this->fetchAs($stmt);

        return new Collection($results);
    }
1264072
protected function query_row ( $sql )
	{
		$sql = $this->sql_printf(func_get_args());
		try 
		{
			$all = $this->conn->query($sql, PDO::FETCH_NUM);
			$row = array();
			foreach ($all as $r) {
				$row = $r;
				break;
			}
		}
		catch (PDOException $e)
		{
			$this->sql_errcheck($sql);
		}
		return $row;
	}
420754
public function sqlFetch(string $sql, array $params = []): ?array
    {
        return $this->prepare($sql, $params)->fetch(\PDO::FETCH_ASSOC);
    }
1336870
protected function getGroupBySql(array $sql): array
    {
        if (empty($this->groupBy)) {
            return $sql;
        }
        $sql[] = 'GROUP BY ' . implode(', ', $this->quoter->quoteByFields($this->groupBy));

        return $sql;
    }
172066
protected function query_row_assoc ( $sql )
	{
		$sql = $this->sql_printf(func_get_args());
		$result = $this->query_all_assoc($sql);
		$val = array_pop($result);
		return $val;
	}
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;
	}
1020803
protected function query_all_assoc ( $sql )
	{
		list($sql, $args) = $this->sql_args(func_get_args());
		return any_db_query_all_assoc($sql, $args);
	}
266547
public function selectValues($sql)
    {
        $result = $this->execute($sql);
        if ($result->count()) {
            $values = [];
            foreach ($result as $row) {
                $values[] = reset($row);
            }
            return $values;
        }
    }