php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25283 SQL Query is pending there, no any result back.
Submitted: 2003-08-28 00:31 UTC Modified: 2003-09-02 18:13 UTC
From: larry_li at contractor dot amat dot com Assigned:
Status: No Feedback Package: MSSQL related
PHP Version: 4.3.2 OS: W2K Server
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: larry_li at contractor dot amat dot com
New email:
PHP Version: OS:

 

 [2003-08-28 00:31 UTC] larry_li at contractor dot amat dot com
Description:
------------
I have a table likes:
plant    char(4),
partID   char(18),
movementType char(3),
txnDate  char(8),
quantity int,
price    smallmoney

I got php.exe freezing while I was trying to query this table by php. I checked process info on SQL management window and found query was not closed. I must kill this process id. Sometimes wait type is sleeping, sometimes is NETWORKIO. First, I just suspend server has not enough socket memoy space and sql server can't write result back. Finally I found it's maybe php's fault. 
When I change price's type to float from smallmoney, I fixed this rpoblem. No any query jam happens. I guess maybe php treats smallmoney's byte length different as SQL server do. Even though SQL server return everything back, php.exe still think serveral bytes will be coming. Just my 2 cents. P.S. SQL server is running on the simplify chinese w2k server.

Reproduce code:
---------------
	$date1=date("Ymd",strtotime($date1));
	$date2=date("Ymd",strtotime($date2));
	$query = "select * from sapinout where txnDate>='$date1' and txnDate<='$date2'";
	$queryResult = $AMC_DB->query($query);
	$header="Date\t";
	$header.="Plant\t";
	$header.="Part ID\t";
	$header.="Movement Type\t";
	$header.="Quantity\t";
	$header.="Price";
	$data="";
	while ( $row = mssql_fetch_array($queryResult) )
	{
		$line="";
		$value = '"' . $row[txnDate] . '"' . "\t"; $line .= $value;
		$value = '"' . $row[plant] . '"' . "\t"; $line .= $value;
		$value = '"' . $row[partID] . '"' . "\t"; $line .= $value;
		$value = '"' . $row[movementType] . '"' . "\t"; $line .= $value;
		$value = '"' . $row[quantity] . '"' . "\t"; $line .= $value;
		$value = '"' . $row[price] . '"' . "\t"; $line .= $value;
		$data .= trim($line)."\n";
	}

Expected result:
----------------
Will return result immedately!

Actual result:
--------------
No any return from web server.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-28 03:21 UTC] sniper@php.net
Remove all old PHP dlls from your system and install the latest PHP release, 4.3.3 first.

 [2003-09-02 18:13 UTC] sniper@php.net
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: Mon Dec 02 17:01:35 2024 UTC