#47950 [Asn->Opn]: Some new MySQLi functions not available as class methods
| From: | johannes@php.net | Date: | Thu, 16 Apr 2009 12:44:01 +0000 |
| Subject: | #47950 [Asn->Opn]: Some new MySQLi functions not available as class methods | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-2105@lists.php.net to get a copy of this message | ||
ID: 47950
Updated by: johannes@php.net
Reported By: werner at procurios dot nl
-Status: Assigned
+Status: Open
-Bug Type: MySQLi related
+Bug Type: Documentation problem
Operating System: *
PHP Version: 5.3CVS, 6CVS (2009-04-13)
Assigned To: mysql
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2009-04-13 12:36:24] 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-11 12:52:30] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47950&edit=1