final public function queryPairs(
        string $query,
        string $keyField,
        string $valueField,
        string $keyPrefix = '',
        $default = false
    ): array {
        $array = $this->queryArray($query) ?: [];
        $return = [];
        foreach ($array as $row) {
            $return[$keyPrefix . ($row[$keyField] ?? '')] = $row[$valueField] ?? $default;
        }
        return $return;
    }
final public function queryPairs(
        string $query,
        string $keyField,
        string $valueField,
        string $keyPrefix = '',
        $default = false
    ): array {
        $array = $this->queryArray($query) ?: [];
        $return = [];
        foreach ($array as $row) {
            $return[$keyPrefix . ($row[$keyField] ?? '')] = $row[$valueField] ?? $default;
        }
        return $return;
    }
final public function queryPairs ( string $ query , string $ keyField , string $ valueField , string $ keyPrefix = '' , $ default = false ) : array { $ array = $ this -> queryArray ( $ query ) ? : [ ] ; $ return = [ ] ; foreach ( $ array as $ row ) { $ return [ $ keyPrefix . ( $ row [ $ keyField ] ?? '' ) ] = $ row [ $ valueField ] ?? $ default ; } return $ return ; }
Return a one dimension array with keys and values defined by keyField and valueField
The resulting array keys can have a prefix defined by keyPrefix
If two keys collapse then the last value will be used
Always return an array, even if it fails

@param string $query
@param string $keyField
@param string $valueField
@param string $keyPrefix
@param mixed $default
@return array
Return a one dimension array with keys and values defined by keyField and valueField The resulting array keys can have a prefix defined by keyPrefix If two keys collapse then the last value will be used Always return an array even if it fails