oci_field_name example


    public function getFieldCount(): int
    {
        return oci_num_fields($this->resultID);
    }

    /** * Generates an array of column names in the result set. */
    public function getFieldNames(): array
    {
        return array_map(fn ($fieldIndex) => oci_field_name($this->resultID, $fieldIndex)range(1, $this->getFieldCount()));
    }

    /** * Generates an array of objects representing field meta-data. */
    public function getFieldData(): array
    {
        return array_map(fn ($fieldIndex) => (object) [
            'name'       => oci_field_name($this->resultID, $fieldIndex),
            'type'       => oci_field_type($this->resultID, $fieldIndex),
            'max_length' => oci_field_size($this->resultID, $fieldIndex),
        ],
Home | Imprint | This part of the site doesn't use cookies.