PHP 4.0 Bug #6202 Updated: Global variables get corrupted while retrieving from a query result
| From: | fmk@php.net | Date: | Fri, 01 Dec 2000 02:43:41 +0000 |
| Subject: | PHP 4.0 Bug #6202 Updated: Global variables get corrupted while retrieving from a query result | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-39763@lists.php.net to get a copy of this message | ||
ID: 6202
Updated by: fmk
Reported By: gsohl@freedomgroup.com
Status: Closed
Bug Type: MSSQL related
Assigned To:
Comments:
This error has been fixed in php4.0.3.
Previous Comments:
---------------------------------------------------------------------------
[2000-11-03 09:13:14] gsohl@freedomgroup.com
I've tested the bug in php 4.0.3pl1 at the prompting of Frank Kromann. It appears that the
problem has been resolved. I tried it with both the php_mssql65.dll and the php_mssql70.dll. It
worked with both. I also went back to the original code I found the problem with (phorum's
EasyAdmin module) and verified that it also worked.
My testing was under Win NT 4.0 Workstation, running IIS 4.0 (or PWS, however you look at it). I
have both the MS SQL 6.5 and the 7.0 clients (Libraries) installed. I was always going against a 6.5
database.
So by virtue of the fact that I can't recreate it (which doesn't necessarily represent
sufficient testing), I'd call it fixed.
- Greg
---------------------------------------------------------------------------
[2000-09-20 23:43:33] gsohl@freedomgroup.com
Here is the trimmed down example code:
<?PHP
$dbSesssion = mssql_connect('TFG_WWW', 'sa', 'xxxxxxx');
mssql_select_db('Support');
$sSQL = "Select thread from testforum where thread > 0 order by thread desc";
$thread_list = mssql_query($sSQL, $dbSesssion);
// $row=mssql_fetch_array($thread_list); // Put this in and the error doesn't occur (I did it
by accident)
echo "max = $max, min = $min<BR>";
echo 'Pos 1<BR>';
$row=mssql_fetch_array($thread_list);
$max=$row["thread"];
echo "Pos 2 - max = $max<BR>";
while (is_array($row))
{
echo "Pos 3 - min = $min<BR>";
echo "1 - max = $max, min = $min<BR>";
$min=$row["thread"];
echo "2 - max = $max, min = $min<BR>";
$row=mssql_fetch_array($thread_list);
echo "3 - max = $max, min = $min<BR>";
}
echo "4 - max = $max, min = $min<BR>";
?>
And again, the script to create the table and insert test data:
CREATE TABLE testforum (
id int NOT NULL ,
datestamp datetime NOT NULL ,
thread int NOT NULL ,
parent int NOT NULL ,
author char (37) NOT NULL ,
subject char (50) NOT NULL ,
email char (50) NOT NULL ,
host char (50) NOT NULL ,
email_reply char (1) NOT NULL ,
approved char (1) NOT NULL
)
GO
insert into testforum
(id,datestamp,thread,parent,author,subject,email,host,email_reply,approved)
values(5,'Aug 16 2000 12:39PM',5,0,'Greg Sohl','Test
Posting','gsohl@freedomgroup.com','GSOHL1','','Y')
GO
insert into testforum
(id,datestamp,thread,parent,author,subject,email,host,email_reply,approved)
values(6,'Aug 16 2000 12:41PM',5,5,'Greg Sohl','RE: Test
Posting','gsohl@freedomgroup.com','GSOHL1','','Y')
GO
---------------------------------------------------------------------------
[2000-09-12 22:48:40] brianlmoon@php.net
Should not have been closed.
---------------------------------------------------------------------------
[2000-09-12 22:30:50] brianlmoon@php.net
It sounds like you are using the MSSQL 7 library to access MSSQL 6.5. This does not work reliably.
You need to compile in the sybase libs to talk to 6.5.
---------------------------------------------------------------------------
[2000-09-06 15:07:33] gsohl@freedomgroup.com
Still happening in 4.0.2.
---------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view the rest of the comments,
please view the bug report online.
Full Bug description available at: http://bugs.php.net/?id=6202