|
mysqli_result::fetch_objectmysqli_fetch_objectFetch the next row of a result set as an object DescriptionObject-oriented style
public objectnullfalse mysqli_result::fetch_object(string
$class = "stdClass", array $constructor_args = [])Procedural style objectnullfalse mysqli_fetch_object(mysqli_result
$result , string $class = "stdClass", array $constructor_args = [])
Fetches one row of data from the result set and returns it as an object,
where each property represents the name of the result set's column.
Each subsequent call to this function will return the next row within the
result set, or If two or more columns of the result have the same name, the last column will take precedence and overwrite any previous data. To access multiple columns with the same name, mysqli_fetch_row may be used to fetch the numerically indexed array, or aliases may be used in the SQL query select list to give columns different names.
Parameters
Return Values
Returns an object representing the fetched row, where each property
represents the name of the result set's column, Errors/Exceptions
A ValueError is thrown when
the Changelog
ExamplesExample #1 mysqli_result::fetch_object example Object-oriented style
Procedural style
The above examples will output something similar to: Pueblo (USA) Arvada (USA) Cape Coral (USA) Green Bay (USA) Santa Clara (USA) See Also
|