php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #43573 mysql_fetch_object: Insufficient documentation of optional parameter
Submitted: 2007-12-12 01:46 UTC Modified: 2007-12-27 02:17 UTC
From: me at signpostmarv dot name Assigned: felipe (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2007-12-12 01:46 UTC] me at signpostmarv dot name
Description:
------------
the documentation defines the class_name parameter as: "The name of the class to instantiate, set the properties of and return. If not specified, a stdClass object is returned."

However, there is nothing in the documentation which suggests how to construct such a class.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-12 10:26 UTC] felipe@php.net
Any class...

Example:
<?php

class foo {
	public $name;
}

// connect && select db

$rs = mysql_query('SELECT name FROM languages LIMIT 1');

$obj = mysql_fetch_object($rs, 'foo');
var_dump($obj);	

?>

Output:
object(foo)#1 (1) { ["name"]=> string(3) "php" }

----
I'll add one example for that parameter, thanks.
 [2007-12-27 02:17 UTC] felipe@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 23:00:01 2026 UTC