php.net |  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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: the dot v at centrum dot cz
New email:
PHP Version: OS:

 

 [2005-10-28 16:33 UTC] the dot v at centrum dot cz
Description:
------------
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).


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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.

Cheers!
--zak
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Dec 05 14:03:37 2021 UTC