|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56620 mysql_fetch_object() with second parameter shows errors
Submitted: 2005-10-28 16:33 UTC Modified: 2005-10-29 18:57 UTC
From: the dot v at centrum dot cz Assigned:
Status: Not a bug Package: mysql (PECL)
PHP Version: 5.0.3 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
34 - 25 = ?
Subscribe to this entry?

 [2005-10-28 16:33 UTC] the dot v at centrum dot cz
I'm actually using PHP 5.0.5, but this version isn't listed as an 'PHP version' option in Pecl bug report.

The problem:

When using optional second parameter, PHP shows fatal error for :
MYSQL_ASSOC: Class '1' not found in 'my script' on line 'line number'.
MYSQL_NUM: Class '2' not found in 'my script' on line 'line number'.
MYSQL_BOTH: Class '3' not found in 'my script' on line 'line number'.

Reproduce code:
$result = mysql_query($query, $dbh);
$row = mysql_fetch_object($result, MYSQL_ASSOC);

Expected result:
Either accept the second parameter or show different kind of error message (e.g. unexpected second parameter if second parameter is deprecated).


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-29 18:57 UTC] zak at greant dot com
This is not a bug in PHP or PECL.

mysql_fetch_object() only takes a single parameter - please read the docs for more details.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Jan 25 18:03:40 2022 UTC