YouTip LogoYouTip

Pdostatement Fetchobject

# PDOStatement::fetchObject [![Image 3: PHP PDO Reference](#)PHP PDO Reference](#) PDOStatement::fetchObject β€” Fetches the next row and returns it as an object. (PHP 5 >= 5.1.0, PECL pdo >= 0.2.4) * * * ## Description ### Syntax mixed PDOStatement::fetchObject ([ string $class_name = "stdClass" [, array $ctor_args ]] ) Fetches the next row and returns it as an object. This function (method) is an alternative to using PDOStatement::fetch() with the PDO::FETCH_CLASS or PDO::FETCH_OBJ style. * * * ## Parameters **class_name** The name of the class to create. **ctor_args** The elements of this array are passed to the constructor. * * * ## Return Values Returns an instance of the requested class with properties matching the column names, or FALSE on failure. * * PHP PDO Reference](#)
← Pdostatement GetattributePdostatement Fetchcolumn β†’