php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #47950 Some new MySQLi functions not available as class methods
Submitted: 2009-04-11 12:52 UTC Modified: 2010-12-20 12:42 UTC
From: werner at procurios dot nl Assigned: vrana (profile)
Status: Closed Package: MySQLi related
PHP Version: 5.3CVS, 6CVS (2009-04-13) OS: *
Private report: No CVE-ID: None
 [2009-04-11 12:52 UTC] werner at procurios dot nl
Description:
------------
While experimenting with the new MySQli functions enabled by compiling with the mysqlnd driver I encountered a problem with the OO MySQLi interface.

I can call the new functions, but contrary to the documentation they dont seem to be available as class methods on a mysqli object.

The only relevant info i could find was this message:
http://lists.mysql.com/commits/21812


full configure string:
./configure --prefix=/usr/local/php --with-apxs2 --with-openssl --enable-bcmath --enable-mbstring --with-curl --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-soap --enable-zip --with-pear=/usr/local/pear --with-zlib --with-zlib-dir=/usr --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/X11R6 --with-freetype-dir=/usr/X11R6 --with-xpm-dir=/usr/X11R6 --with-gd --with-mcrypt=/usr/local/lib --with-tidy=/usr/local

Reproduce code:
---------------
<?php

$mysqli = new mysqli();

if (function_exists(mysqli_fetch_all) && !method_exists($mysqli, 'fetch_all')) {
	echo 'mysqli_fetch_all not a class method <br />';
}

if (function_exists(mysqli_get_cache_stats) && !method_exists($mysqli, 'mysqli_get_cache_stats')) {
	echo 'mysqli_get_cache_stats not a class method <br />';
}

if (function_exists(mysqli_get_client_stats) && !method_exists($mysqli, 'mysqli_get_client_stats')) {
	echo 'mysqli_get_client_stats not a class method <br />';
}

if (function_exists(mysqli_get_connection_stats) && !method_exists($mysqli, 'mysqli_get_connection_stats')) {
	echo 'mysqli_get_connection_stats not a class method <br />';
}
?>

Expected result:
----------------
no output expected

Actual result:
--------------
mysqli_fetch_all not a class method
mysqli_get_cache_stats not a class method
mysqli_get_client_stats not a class method
mysqli_get_connection_stats not a class method

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-13 12:36 UTC] jani@php.net
The test script is very flawed, for one it does not enclose strings 
in quotes and also uses wrong method names..

The correct methods that do exist:

http://www.php.net/manual/en/mysqli-result.fetch-all.php
http://www.php.net/manual/en/mysqli.get-connection-stats.php

These really DO NOT exist as methods:

http://www.php.net/manual/en/mysqli.get-cache-stats.php
http://www.php.net/manual/en/mysqli.get-client-stats.php


 [2009-04-16 12:44 UTC] johannes@php.net
Methods in the mysqli class reference a specific connection whereas the mentioned functions work on the process which might not only include m,multiple connections but also reference statistics collected during multiple requests. Therefore we won't offer them as part of the class and the documentation should be fixed accordingly.
 [2009-11-19 10:52 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2009-11-19 10:53 UTC] svn@php.net
Automatic comment from SVN on behalf of vrana
Revision: http://svn.php.net/viewvc/?view=revision&revision=290975
Log: Some functions don't exist as methods (bug #47950)
 [2010-12-20 12:42 UTC] jani@php.net
-Package: Tidy +Package: MySQLi related -Assigned To: +Assigned To: vrana
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 09 20:01:32 2024 UTC