getFieldCount example


        return pg_num_fields($this->resultID);
    }

    /** * Generates an array of column names in the result set. */
    public function getFieldNames(): array
    {
        $fieldNames = [];

        for ($i = 0, $c = $this->getFieldCount()$i < $c$i++) {
            $fieldNames[] = pg_field_name($this->resultID, $i);
        }

        return $fieldNames;
    }

    /** * Generates an array of objects representing field meta-data. */
    public function getFieldData(): array
    {
        

        $this->removeDBPrefix();

        foreach ($tables  as $id => $tableName) {
            $table = $this->db->protectIdentifiers($tableName);
            $db    = $this->db->query("SELECT * FROM {$table}");

            $this->tbody[] = [
                $id + 1,
                $tableName,
                $db->getNumRows(),
                $db->getFieldCount(),
            ];
        }

        $this->restoreDBPrefix();

        if ($this->sortDesc) {
            krsort($this->tbody);
        }

        return $this->tbody;
    }

    

    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),
        ],

        return $this->resultID->numColumns();
    }

    /** * Generates an array of column names in the result set. */
    public function getFieldNames(): array
    {
        $fieldNames = [];

        for ($i = 0, $c = $this->getFieldCount()$i < $c$i++) {
            $fieldNames[] = $this->resultID->columnName($i);
        }

        return $fieldNames;
    }

    /** * Generates an array of objects representing field meta-data. */
    public function getFieldData(): array
    {
        
Home | Imprint | This part of the site doesn't use cookies.