|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-08-28 03:21 UTC] sniper@php.net
[2003-09-02 18:13 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 16 22:00:01 2025 UTC |
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.