php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #20656 Feature Request: mysql_fetch_object as user defined class
Submitted: 2002-11-26 13:02 UTC Modified: 2010-05-03 13:33 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: publicNO at SPAM dot itsminimal dot com Assigned: helly (profile)
Status: Not a bug Package: *General Issues
PHP Version: 5* OS: *
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: publicNO at SPAM dot itsminimal dot com
New email:
PHP Version: OS:

 

 [2002-11-26 13:02 UTC] publicNO at SPAM dot itsminimal dot com
I think it would be very useful to be able to specify the class of the object returned by mysql_fetch_object.  

So perhaps the syntax would be

mysql_fetch_object ( resource result, classname )

and the object returned would have all the properties and methods of the user defined class, in addition to having  properties that correspond to the fetched row

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-10 12:11 UTC] php at thekid dot de
Sybase-CT supports this:
http://php.net/manual/en/function.sybase-fetch-object.php

Porting this to MySQL should be no problem.
 [2004-01-11 19:39 UTC] helly@php.net
pgsql, SQLite, mysqli and pdo support the following function in PHP5:
object mysqli_fetch_object (object result [, string class_name [, NULL|array ctor_params]])

I will adatpt this to mysql for completeness. Anyway there will be no new functionality in PHP4.3.x
 [2010-05-03 13:33 UTC] johannes@php.net
-Status: Open +Status: Bogus -Package: Feature/Change Request +Package: *General Issues
 [2010-05-03 13:33 UTC] johannes@php.net
The mysql extension won't get new features. Use mysqli or PDO or such.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 08:01:29 2024 UTC