#29974 [Opn->Fbk]: num_rows crashes Apache (recurrence)
| From: | georg@php.net | Date: | Wed, 15 Sep 2004 07:30:28 +0000 |
| Subject: | #29974 [Opn->Fbk]: num_rows crashes Apache (recurrence) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-66191@lists.php.net to get a copy of this message | ||
ID: 29974
Updated by: georg@php.net
Reported By: david dot powers at dial dot pipex dot com
-Status: Open
+Status: Feedback
Bug Type: MySQLi related
Operating System: Windows XP
PHP Version: 5.0.1
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.0-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2004-09-03 19:40:11] david dot powers at dial dot pipex dot com
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 this bug report at http://bugs.php.net/?id=29974&edit=1