#25544 [Opn->Bgs]: Only 255 characters returned from varchar field
| From: | iliaa@php.net | Date: | Mon, 15 Sep 2003 22:30:56 +0000 |
| Subject: | #25544 [Opn->Bgs]: Only 255 characters returned from varchar field | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-47602@lists.php.net to get a copy of this message | ||
ID: 25544
Updated by: iliaa@php.net
Reported By: snick at getart dot ru
-Status: Open
+Status: Bogus
Bug Type: MSSQL related
Operating System: Windows 2003 Server
PHP Version: 4.3.2
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
You're dealing with VARCHAR maximum length limitation of 255
characters. This is not a PHP bug.
Previous Comments:
------------------------------------------------------------------------
[2003-09-15 09:37:12] snick at getart dot ru
Description:
------------
Then I try to read value of VARCHAR field I get only 255 characters,
but VARCHAR is 8000 bytes long.
MSSQL v. 7.0
ntwdblib.dll v. 2000.80.194.0
PHP v. 4.3.2
Apache v. 2.0.43 / IIS 6
Reproduce code:
---------------
$myVar = str_repeat("*", 500);
mssql_query("DELETE FROM myTable");
mssql_query("INSERT INTO myTable (myField) VALUES ('".$myVar."')");
$query = "SELECT LEN(myField), myField FROM myTable";
list($realLength, $myVar) = mssql_fetch_row(mssql_query($query));
echo "DB length: ".$realLength."; PHP length: ".strlen($myVar);
Expected result:
----------------
$myVar must be equal $realLength
Actual result:
--------------
strlen($myVar) == 255 (always)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25544&edit=1