final public function queryArrayOne(string $query, string $field = '')
    {
        $result = $this->queryResult($query);
        if (false === $result) {
            return false;
        }

        $return = [];
        $verifiedFieldName = false;
        while ($row = $result->fetchRow()) {
            if ('' === $field) {
                $keys = array_keys($row);
                $field = $keys[0];
                $verifiedFieldName = true;
            }
            if (! $verifiedFieldName) {
                if (! array_key_exists($field, $row)) {
                    return false;
                }
                $verifiedFieldName = true;
            }
            $return[] = $row[$field] ?? null;
        }
        return $return;
    }
final public function queryArrayOne(string $query, string $field = '')
    {
        $result = $this->queryResult($query);
        if (false === $result) {
            return false;
        }

        $return = [];
        $verifiedFieldName = false;
        while ($row = $result->fetchRow()) {
            if ('' === $field) {
                $keys = array_keys($row);
                $field = $keys[0];
                $verifiedFieldName = true;
            }
            if (! $verifiedFieldName) {
                if (! array_key_exists($field, $row)) {
                    return false;
                }
                $verifiedFieldName = true;
            }
            $return[] = $row[$field] ?? null;
        }
        return $return;
    }
final public function queryArrayOne ( string $ query , string $ field = '' ) { $ result = $ this -> queryResult ( $ query ) ; if ( false === $ result ) { return false ; } $ return = [ ] ; $ verifiedFieldName = false ; while ( $ row = $ result -> fetchRow ( ) ) { if ( '' === $ field ) { $ keys = array_keys ( $ row ) ; $ field = $ keys [ 0 ] ; $ verifiedFieldName = true ; } if ( ! $ verifiedFieldName ) { if ( ! array_key_exists ( $ field , $ row ) ) { return false ; } $ verifiedFieldName = true ; } $ return [ ] = $ row [ $ field ] ?? null ; } return $ return ; }
Return one dimensional array with the values of one column of the query
If the field is not set then the function will take the first column

@param string $query
@param string $field
@return array|false
Return one dimensional array with the values of one column of the query If the field is not set then the function will take the first column