|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-05-27 08:46 UTC] sniper@php.net
[2005-06-04 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 13:00:01 2025 UTC |
Description: ------------ We are using PHP 5.0.4/Apache 2.0.54 with FreeTDS 0.63 against a SQL Server 2000 server. When fetching money or smallmoney fields from the database, the return value is a string of size 28 or 24 respectively. This problem has surfaced when upgrading our web servers from 4.3.2 to 5.0.4. Version 4.3.2 behaves as expected. I have used the php.ini-dist out of the box to produce this problem. The configure line is as follows: ./configure \ --with-apxs2=/usr/local/apache/bin/apxs \ --enable-bcmath \ --enable-wddx \ --with-config-file-path=/etc/php4/cgi \ --with-xml \ --with-zlib \ --enable-memory-limit \ --with-sybase=/usr/local/freetds \ --enable-magic-quotes=yes \ --enable-force-cgi-redirect \ --with-gd \ --enable-gd-native-ttf \ --with-zlib-dir=/usr/include \ --with-jpeg-dir=/usr \ --with-png-dir=/usr \ --with-cpdflib=/usr/local \ --with-ttf=/usr \ --with-mysql=/usr/include/mysql \ --with-freetype_dir=/usr/include/freetype2 Reproduce code: --------------- mssql_connect("Server", "UserName","Password"); mssql_select_db("Database"); $sql="Select SmallMoneyField from Table"; $result = mssql_query($sql); $row = mssql_fetch_array($result); while ($row = mssql_fetch_array($result)) { $data[] .= $row["SmallMoneyField"]; echo $row["TransactionAmount"]; } echo strlen($ydata[1]) . '<br>'; Expected result: ---------------- When the code is executed I expect to see a return of a money field with a string length equalling the number of digits (ex. "5.00" should be string length of 4). Output of the string, when viewing the browser source, shows a number followed by spaces. Actual result: -------------- For money fields I get a string length of 28, regardless of the actual number length and a string length of 24 for smallmoney fields. Other fields, such as text, varchar and integers behave as expected with values matching the number of digits/characters.