From: nguyenhoang at vnideadesign dot com Operating system: XP sp2 PHP version: 5.1.4 PHP Bug Type: MSSQL related Bug description: Result fetched from MSSQL is truncated to 255 characters
Description: ------------ Problem on: PHP 5.1.2 and 5.1.4 OS: Windows XP sp2 Server: Apache ( apache2triad 1.5.4/1.4.4 and WAMP5 with PHP 5.1.4 i was un/installing each of these server to test) I'm sure that I connected to MSSQL server 2000 and ran a stored procedure ( after enable mssql extention ) but i only got the first 255 characters from the remote MSSQL server. From PHP version 5.1.2, I upgraded it to PHP 5.1.4 but the result is as it was on PHP 5.1.2. Read the note from other PHP user, i got these way to fix this problem: -in php file: mssql_query("set textsize 4000", $s); // <<<<<<<< ini_set('mssql.textsize', '4000'); ini_set('mssql.textlimit', '4000'); -in php.ini mssql.textlimit = 4096 mssql.textsize = 4096 After the fix, the result has no changed, always is the first 255 chars appeared. Reproduce code: --------------- Here is the code. //Connect: $s = @mssql_connect($myServer, $myUser, $myPass) or die("He Thong dang ban. Xin ban thu lai trong giay lat. Chung toi rat tiec vi su co nay. Rat mong ban thong cam.."); $d = @mssql_select_db($myDB, $s) or die("He Thong dang ban. Xin ban thu lai trong giay lat. Chung toi rat tiec vi su co nay. Rat mong ban thong cam.."); //.......other code here, then the line to got row Text from MSSQL database /* #GOT INFO - QUERY DATABASE!!!!!!! */ $datetime = $d . "/" . $m . "/" . $y; if ($smstxt[1] == "SAT") { // Bind datetime $rs = mssql_query("TG_SAT '$datetime','$enableU2Text'"); } else { $rs = mssql_query("TG_CAT '$datetime','$enableU2Text'"); } $row = mssql_fetch_array($rs); // Display the result GoKannel($row['Text']); // Expected result: ---------------- I have no idea to expect what problem with my code. It run perfectly with other part of the scipt. I wish that the text on MSSQL was not more than 255 chars, If so this should not be a problem. Maybe there was a problem with php_mssql.dll extention or maybe I am a stupid PHP coder :( Hope u can give me an answer. Thanks -- Edit bug report at http://bugs.php.net/?id=37757&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37757&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37757&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37757&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37757&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37757&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37757&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=37757&r=needscript Try newer version: http://bugs.php.net/fix.php?id=37757&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37757&r=support Expected behavior: http://bugs.php.net/fix.php?id=37757&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37757&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37757&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37757&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37757&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37757&r=dst IIS Stability: http://bugs.php.net/fix.php?id=37757&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37757&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37757&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37757&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=37757&r=mysqlcfg