sqlsrv_fetch_object example

/** * Returns the result set as an object. * * @return Entity|false|object|stdClass */
    protected function fetchObject(string $className = 'stdClass')
    {
        if (is_subclass_of($className, Entity::class)) {
            return empty($data = $this->fetchAssoc()) ? false : (new $className())->injectRawData($data);
        }

        return sqlsrv_fetch_object($this->resultID, $className);
    }

    /** * Returns the number of rows in the resultID (i.e., SQLSRV query result resource) */
    public function getNumRows(): int
    {
        if (is_int($this->numRows)) {
            $this->numRows = sqlsrv_num_rows($this->resultID);
        }

        
Home | Imprint | This part of the site doesn't use cookies.