public function fetchPairs(string $sql, array $params = [])
    {
        $stmt = $this->prepare($sql, $params);
        $result = $stmt->fetchAll(\PDO::FETCH_KEY_PAIR);

        $this->ok();
        return $result;
    }
public function fetchPairs(string $sql, array $params = [])
    {
        $stmt = $this->prepare($sql, $params);
        $result = $stmt->fetchAll(\PDO::FETCH_KEY_PAIR);

        $this->ok();
        return $result;
    }
public function fetchPairs ( string $ sql , array $ params = [ ] ) { $ stmt = $ this -> prepare ( $ sql , $ params ) ; $ result = $ stmt -> fetchAll ( \ PDO :: FETCH_KEY_PAIR ) ; $ this -> ok ( ) ; return $ result ; }
Returns a key-value array

@param  string $sql    SQL query with placeholders
"SELECT id, username FROM users WHERE ip = :ip"
@param  array  $params params for query placeholders (optional)
array (':ip' => '127.0.0.1')

@return array|false
@throws DbException
Returns a key - value array