ID: 26876 Updated by: [EMAIL PROTECTED] Reported By: agnerm at aloc dot dk -Status: Open +Status: Bogus Bug Type: MSSQL related Operating System: Windows 2000 PHP Version: 4.3.4 New Comment:
>From manual comments for mssql_query(): "if you're experiencing truncates of your binary data read from mssql database (it looks like incomplete, broken or even no images) check mssql section of your php.ini file and set values of mssql.textlimit and mssql.textsize variables to their maximum (2147483647) or at least bigger size than the default is" Previous Comments: ------------------------------------------------------------------------ [2004-01-12 03:26:45] agnerm at aloc dot dk Description: ------------ When trying to get a IMAGE-field from a MSSQL database I only get the first 4096. Reproduce code: --------------- function SQL($sqlStatement) { global $sqlConnection,$sqlDB; mssql_select_db($sqlDB,$sqlConnection) or die("fejl ved \"connection\" til databasen ($sqlDB)"); $rs = mssql_query($sqlStatement,$sqlConnection) or die("Fejl i Sql-".nl2br($sqlStatement)); return $rs; } function SQL2D($sqlStatement,$antal=-1) { global $sqlConnection,$sqlDB; $dataArray=""; $rs=SQL($sqlStatement,$sqlDB); if (mssql_num_rows($rs)==0) return null; if ($antal==-1) $antal=mssql_num_rows($rs); for ($y=0;(($y<mssql_num_rows($rs))&&($y<$antal));$y++) { $row = mssql_fetch_row($rs); for($i=0;$i<count($row);$i++) { $dataArray[$y][mssql_field_name($rs,$i)]=$row[$i]; } } return $dataArray; } SQL("SET TEXTSIZE 512000"); SQL2D_out("SELECT @@TEXTSIZE"); $fil=SQL2D("SELECT len= DATALENGTH(dbo.nyheder.fil),dbo.nyheder.fil from dbo.nyheder where nyhederid=9"); echo $fil[0]["len"]; echo "\n<br>"; echo strlen ($fil[0]["fil"]); Expected result: ---------------- <table border=1> <tr> <td>computed</td> </tr> <tr> <td>512000</td> </tr> </table> 34510 <br>34510 Actual result: -------------- <table border=1> <tr> <td>computed</td> </tr> <tr> <td>512000</td> </tr> </table> 34510 <br>4096 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26876&edit=1