|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-11-01 08:19 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 02:00:01 2025 UTC |
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'