|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23167 Apache fails when field of some recordset is passed to "switch" operator.
Submitted: 2003-04-11 09:36 UTC Modified: 2003-04-21 09:22 UTC
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: rart at mail dot ru Assigned:
Status: No Feedback Package: MSSQL related
PHP Version: 4.3.1 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
48 - 10 = ?
Subscribe to this entry?

 [2003-04-11 09:36 UTC] rart at mail dot ru
If I passed the recordset's field to the "switch" operator then Apache fails:

----- cut here (begin) -----
Apache.exe has encountered a problem and needs to close.  We are sorry for the inconvenience.

szAppName : Apache.exe     szAppVer :     szModName : ntdll.dll     
szModVer : 5.1.2600.1106     offset : 00001d24     
----- cut here (end) -----

The following script can be used to reproduce the problem:

----- cut here (begin) -----
// establish connection to database
$conn = new COM("ADODB.Connection");
$conn->ConnectionString = 
    "driver={SQL Server}; " .
    "server=; " .
    "database=mydatabase; " .
    "uid=sa; " .
$conn->ConnectionTimeout = 15;
$conn->CommandTimeout = 30;

// select some data
$rset = new COM("ADODB.Recordset");
$rset = $conn->Execute("select myfield from mytable");

if (!$rset->eof)
    // on the line below Apache will be failed
    switch ($rset->fields["myfield"]->value)
        // ...
----- cut here (end) -----

This problem can be avoided in the following way:

----- cut here (begin) -----
    $value = $rset->fields["myfield"]->value;
    switch ($value)
        // ...
----- cut here (end) -----

As far as I can see this is the PHP's bug. Please let me know if I wrong. Below is some information about my workstation:

MS Windows XP Professional SP1
MS SQL Server 2000 SP3
Apache 1.3.27 (installed like a service)
PHP 4.3.1

If you need some additional information (e.g. some settings from "php.ini") please feel free to ask me.

Best regards, Artem Rodygin.
Rhonda Ltd.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-11 19:32 UTC]
Please try using this CVS snapshot:
For Windows:

Alot have changed since 4.3.1 and this might be fixed.
 [2003-04-21 09:22 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 26 09:01:32 2024 UTC