php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #39847 mysqli_fetch_[field|fields|field_direct] need to return db
Submitted: 2006-12-15 19:51 UTC Modified: 2011-01-17 12:23 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: marzillo at emdeon dot com Assigned: kalle
Status: Closed Package: MySQLi related
PHP Version: 5.2.0 OS: *
Private report: No CVE-ID:
 [2006-12-15 19:51 UTC] marzillo at emdeon dot com
Description:
------------
The mysqli functions fetch_field, fetch_fields and fetch_field_direct do not return the db name when the C API allows it.  For the past several versions I have been adding the following code to mysqli_api.c to include this field.  Could this be included in future releases?

mysqli_fetch_field function
add_property_string(return_value, "db",(field->db ? field->db : ""), 1);

mysqli_fetch_fields function
add_property_string(obj, "db",(field->db ? field->db : ""), 1);

mysqli_fetch_field_direct
add_property_string(return_value, "db",(field->db ? field->db : ""), 1);



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-01 23:46 UTC] jani@php.net
-Package: Feature/Change Request +Package: MySQLi related
 [2011-01-01 23:47 UTC] jani@php.net
-Summary: mysqli_fetch_field/_fetch_fields/_fetch_field_direct need to return db +Summary: mysqli_fetch_[field|fields|field_direct] need to return db -Operating System: Linux +Operating System: *
 [2011-01-06 14:53 UTC] uw@php.net
-Assigned To: +Assigned To: mysql
 [2011-01-06 14:53 UTC] uw@php.net
Andrey? Sounds like a valid request... let's do....
 [2011-01-07 19:25 UTC] kalle@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&revision=307231
Log: Implemented FR #39847 (mysqli_fetch_[field|fields|field_direct] need to return db)
 [2011-01-07 19:29 UTC] kalle@php.net
-Assigned To: mysql +Assigned To: kalle
 [2011-01-07 19:29 UTC] kalle@php.net
I implemented this in trunk for mysqli, keeping this open until its decided whether this should be merged to 5.3
 [2011-01-17 12:20 UTC] kalle@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&revision=307533
Log: MFT: Added 'db' and 'catalog' keys to the field fetching functions (FR #39847)
 [2011-01-17 12:22 UTC] kalle@php.net
-Status: Assigned +Status: Closed
 [2011-01-17 12:22 UTC] kalle@php.net
This will appear in PHP 5.3.6 :)
 [2011-01-17 12:23 UTC] kalle@php.net
Forgot to mention, 'catalog' will also be available along with 'db'
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 24 21:01:55 2014 UTC