php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30088 mysqli and apache combo => serious crash
Submitted: 2004-09-14 19:55 UTC Modified: 2004-09-18 20:54 UTC
From: costinb at mymail dot ro Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 5.0.1 OS: Windowx XP Prof
Private report: No CVE-ID: None
 [2004-09-14 19:55 UTC] costinb at mymail dot ro
Description:
------------
Read on

Reproduce code:
---------------
OK
Take a db object, $db = new mysqli(...);
Run a query on it: 
$query = "...";
if (!($result = $db->query($query)) or !$db->num_rows) {
  echo "No rows";
}

Well, that if would crash Apache 1.3 running PHP 5.0.1 unless I write it like this:
if (!(result = $db->query($query))) {
    if (!$db->num_rows) {
        echo "No rows";
    }
}

I reverted to PHP 5.0.0 and all worked fine once again.


Expected result:
----------------
up

Actual result:
--------------
up

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-15 08:49 UTC] derick@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.

 [2004-09-15 09:32 UTC] georg@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

see #29974. 
and try latest snapshot. 
 
Also your script is buggy: Connection object has no 
num_rows property. 
 [2004-09-18 19:00 UTC] costinb at mymail dot ro
The bug exists on linux too. It was not $db->num_rows but $result->num_rows, you should have figured that. I'll try the latest snapshot
 [2004-09-18 20:54 UTC] georg@php.net
. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Oct 09 04:01:27 2024 UTC