From: rk at yes-co dot nl
Operating system: Debian
PHP version: 5.1.6
PHP Bug Type: MySQLi related
Bug description: Unable to extend mysqli class properly without causing
various fatal errors
Description:
------------
Problem with extension of mysqli library.
Reproduce code:
---------------
<?php
//loaded mysql via dl() function
$server = 'localhost'; $dbname = 'ws_matching'; $username = 'root';
$password = ''; $port = 3306; $socket = '/tmp/mysql.sock';
class example_mysqli extends mysqli{
function query($query){
$result = parent::query($query);
if(mysqli_error($this)){
throw new exception(mysqli_error($this), mysqli_errno($this));
}
return $result;
}
}
//$my = new mysqli($server,$username,$password,$dbname,$port,$socket);
//works properly
$my = new example_mysqli($server,$username,$password,
$dbname,$port,$socket); //gives strange errors
$result = $my->query('SELECT * FROM housesnl_demand');
while($row = $result->fetch_row()){
print_r($row);
}
$result->close();
$my->close();
?>
Expected result:
----------------
Array ( [0] => 2006-09-25 12:09:58 )
Actual result:
--------------
possible fatal errors:
Fatal error: mysqli_stmt::data_seek() must be derived from
example_mysqli::data_seek in Unknown on line 0
Fatal error: mysqli_stmt::bind_param() must be derived from
example_mysqli::bind_param in Unknown on line 0
Warning: Wrong parameter count for mysqli_stmt::mysqli_stmt() in
/mnt/data/home/rob/public_html/MatchingRevised/strange_error_mysqli.php on
line 19
Fatal error: Call to undefined method mysqli_warning::query() in
/mnt/data/home/rob/public_html/MatchingRevised/strange_error_mysqli.php on
line 11
etc... error changes
--
Edit bug report at http://bugs.php.net/?id=38947&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=38947&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=38947&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=38947&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38947&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=38947&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38947&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38947&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38947&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38947&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38947&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=38947&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=38947&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38947&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38947&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38947&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38947&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38947&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38947&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38947&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38947&r=mysqlcfg