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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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-2022 The PHP Group
All rights reserved.
Last updated: Sat Jan 22 18:03:35 2022 UTC