#30644 [NEW]: same strlen of mssql filed value

From: Date: Mon, 01 Nov 2004 07:10:44 +0000
Subject: #30644 [NEW]: same strlen of mssql filed value
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-68567@lists.php.net to get a copy of this message
From: chenxi at shine dot com dot cn Operating system: LINUX RedHat9 PHP version: 5.0.2 PHP Bug Type: MSSQL related Bug description: same strlen of mssql filed value Description: ------------ Select data from mssql, and get length of the filed value by using function strlen(), but i got the same output '40', following is field info and smaple code. Reproduce code: --------------- name utName (char) 40 $dbh = @mssql_connect($tnserver_ipaddr, $tnserver_user, $tnserver_passwd); if ($dbh) { $room_num = GetRoomNum(); mssql_select_db("this"); $sql = "SELECT * FROM [dbo].[HotelFolioView] WHERE (RoomNo = '$room_num')"; $ret = mssql_query($sql); while ($row = mysql_fetch_array($ret)) { print strlen($row['name']).'\r\n'; } mssql_free_result($ret); } Expected result: ---------------- 4 7 12 8 .... different length Actual result: -------------- 40 40 40 40 .... all same '40', this is length of filed 'name' -- Edit bug report at http://bugs.php.net/?id=30644&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30644&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30644&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30644&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30644&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30644&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30644&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30644&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30644&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30644&r=support Expected behavior: http://bugs.php.net/fix.php?id=30644&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30644&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30644&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30644&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30644&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30644&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30644&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30644&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30644&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30644&r=mysqlcfg

« previous php.bugs (#68567) next »