numColumns example


class Result extends BaseResult
{
    /** * Gets the number of fields in the result set. */
    public function getFieldCount(): int
    {
        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);
        }
Home | Imprint | This part of the site doesn't use cookies.