php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15083 Big bug with mssql_fetch_xxxx methods
Submitted: 2002-01-17 09:17 UTC Modified: 2002-01-18 03:22 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: mi at cemag dot de Assigned:
Status: Closed Package: MSSQL related
PHP Version: 4.1.1 OS: Windows 2000 Pro
Private report: No CVE-ID: None
 [2002-01-17 09:17 UTC] mi at cemag dot de
On PHP 4.0.6 on Windows 2000 Pro
 
I use the php_mssql.dll extension to access mssql server 7.0 and all the method works very well.
(hum!! only the problem with ntext type but with CAST(yourfieldname AS text) on the SQL query, that disappears)


After updating to PHP 4.1.1 on Windows 2000 Pro

The same code crashes Apache and Windows displays a dialog box with :  

Apache.exe
The instruction at "0x006db197" referenced memory at "0x043bcc3a".
The memory could not be "written".

I have search for a long time in the SQL query but in reality the problem is not there...

The problem depends of the type returned by the query. 
All the numerical types work fine but all the string types like char, nchar, text, ... result in crashes.

This problem appears only when you try to read the result with mssql_fetch_xxxx methods...


My configuration :
Windows 2000 Pro
MSSQL SERVER 7.0
APACHE 1.3.20
PHP 4.1.1 (same problem with PHP 4.1.0)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-17 13:44 UTC] sander@php.net
Can you provide a sample script?
 [2002-01-17 13:45 UTC] sander@php.net
Status -> feedback
 [2002-01-18 03:22 UTC] mi at cemag dot de
<?
	
	//////////////////////////////////
	//
	// Apologize for the bug information,
	// the mssql functions work fine...
	// But the problem occurs only when set_magic_quotes_runtime is set to true on PHP 4.1.1
	// with version 4.0.6, the problem don't appear.
	//
	set_magic_quotes_runtime(true);
	
	$conn = mssql_connect(yourHostname, yourUsername, yourPassword);
	mssql_select_db(yourDatabase, $conn);
		
	$result = mssql_query("SELECT name FROM Country"); // name type nchar
	$count  = mssql_num_rows($result)	
	
	$value  = array();
	for($i = 0; $i < $count; $i++) { $value[] = mssql_fetch_object($result); }
	print_r($value);
	
	mssql_free_result($result);
	mssql_close($conn);
	
?>

 [2002-03-31 07:32 UTC] nirav at magnet-i dot com
I had the same problem with Windows XP Pro, MSSQL 2000 and PHP 4.1.1 / 4.1.2, Apache 1.3.20

MSSQL functions were working fine otherwise, but it used to crash with mssql_fetch_array function. If I called mssql_fetch_row, it crashed once, but still showed some output in the browser.

Keeping set_magic_quotes_runtime(false);  solved the issue.

I hope this gets fixed soon.

Thank you.
 [2002-06-06 04:33 UTC] webmaster at cbrichardellis dot fr
Apache Crash still occur with PHP 4.2.1.
I confirm mssql_fetch_array crash Apache every time when returning non numeric/Date fields.

My Config:
Win2k Pro
Apache 1.3.24 / 2.0.36
MSSQL 7

Thanks 
Clement
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 02 05:01:29 2024 UTC