|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29974 num_rows crashes Apache (recurrence)
Submitted: 2004-09-03 19:40 UTC Modified: 2004-09-23 01:00 UTC
Avg. Score:4.5 ± 0.7
Reproduced:10 of 10 (100.0%)
Same Version:8 (80.0%)
Same OS:6 (60.0%)
From: david dot powers at dial dot pipex dot com Assigned:
Status: No Feedback Package: MySQLi related
PHP Version: 5.0.1 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: david dot powers at dial dot pipex dot com
New email:
PHP Version: OS:


 [2004-09-03 19:40 UTC] david dot powers at dial dot pipex dot com
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.


Windows XP Pro
Apache 1.3.31
PHP 5.0.1
MySQL 4.1.4-gamma


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:
szModName: php_mysql.dll szModVer:
offset: 000011fe

Code works perfectly if $total = $result->num_rows; is commented out.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-15 09:30 UTC]
Please try using this CVS snapshot:
For Windows:

 [2004-09-20 01:31 UTC] splash2 at splashtech dot net
I also had this issue on php 5.0.1 final release... I downloaded the latest (at this time) snapshot located at

The issue is resolved in that version. :)
 [2004-09-23 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2006-02-16 16:09 UTC] grikdotnet at aim dot com
I have a crash (segfault) when accessing the num_rows field after $result->close() is called.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Feb 29 11:01:31 2024 UTC