PHP 4.0 Bug #6202 Updated: Global variables get corrupted while retrieving from a query result

From: Date: Fri, 03 Nov 2000 14:13:14 +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-36955@lists.php.net to get a copy of this message
ID: 6202 User Update by: gsohl@freedomgroup.com Status: Open Bug Type: MSSQL related Description: Global variables get corrupted while retrieving from a query result 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 Previous Comments: --------------------------------------------------------------------------- [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. --------------------------------------------------------------------------- [2000-08-16 17:26:27] gsohl@freedomgroup.com This was against a MS SQL 6.5 server. My PHP.INI contains extension=php_mssql70.dll --------------------------------------------------------------------------- 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

« previous php.dev (#36955) next »