From: david dot powers at dial dot pipex dot com
Operating system: Windows XP
PHP version: 5.0.1
PHP Bug Type: MySQLi related
Bug description: num_rows crashes Apache (recurrence)
Description:
------------
Bug #28205 reported fixed in PHP 5.RC-3 appears to have resurfaced.
Use of $result->num_rows causes Apache to crash. Use of mysqli_num_rows()
works without problem.
Environment:
Windows XP Pro
Apache 1.3.31
PHP 5.0.1
MySQL 4.1.4-gamma
extension=php_mbstring.dll
extension=php_mysqli.dll
extension=php_mysql.dll
Reproduce code:
---------------
$db = new mysqli($hostname, $username, $password, 'db_name');
$sql = 'SELECT * FROM wordlist';
$result = $db->query($sql);
$total = $result->num_rows;
echo "<h1>Total words: $total</h1>";
while ($row = $result->fetch_assoc()) {
echo $row['word'].'<br />';
}
Expected result:
----------------
I expect it not to crash.
Actual result:
--------------
Error report:
szAppName: Apache.exe szAppVer: 0.0.0.0
szModName: php_mysql.dll szModVer: 5.0.1.1
offset: 000011fe
Code works perfectly if $total = $result->num_rows; is commented out.
--
Edit bug report at http://bugs.php.net/?id=29974&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29974&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=29974&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=29974&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=29974&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29974&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29974&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29974&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29974&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29974&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29974&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29974&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29974&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29974&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29974&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29974&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29974&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29974&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29974&r=float