PHP PDOStatement:: fetchObject Explanation

  • 2021-11-14 05:08:10
  • OfStack

PDOStatement::fetchObject

PDOStatement:: fetchObject--Gets the next 1 row and returns it as an object. (PHP 5 > = 5.1.0, PECL pdo > = 0.2.4)

Description

Grammar


mixed PDOStatement::fetchObject ([ string $class_name = "stdClass" [, array $ctor_args ]] )

Gets the next 1 row and returns it as 1 object. This function (method) is in the style of PDO:: FETCH_CLASS or PDO:: FETCH_OBJ PDOStatement::fetch() 1 substitution of.

Parameter

class_name

Creates the name of the class.

ctor_args

The elements of this array are passed to the constructor.

Return value

Returns 1 instance of the required class whose attribute name corresponds to the column name, or FALSE on failure.

Summarize


Related articles: