String truncate problem of varchar when interfacing with a MS SQL server

From: Date: Mon, 30 Sep 2002 10:40:21 +0000
Subject: String truncate problem of varchar when interfacing with a MS SQL server
Groups: php.windows 
Request: Send a blank email to php-windows+get-16070@lists.php.net to get a copy of this message
Hello, First of all I've been looking for days on the net, trying to find a solution before I came here. I've found similar cases, but never a solution... This is my problem: When using the php_mssql extension to access a database (of which I can't make changes to its design) running on MS SQL Server 2000, -whether it's on windows or linux- containing fields with the attribute e.g. "varchar(800)", they all get truncated at 255 characters in length. I know that MY SQL etc only supports varchar up to 255 chars, and from then on blob is used; but it seems that with MS SQL 2k varchar is supported up to about 8000 chars in length. The problem is, when you retrieve such a varchar, php only gets 255 chars. I don't know how to work around this problem; is it possible that this is a bug, or that I have to run a certain command on the MS SQL before I fetch that variable? If so, which command would it be? I'd appreciate all help ... thanks a lot! Kind regards, Filip De Graeve blacktor@pi.be

« previous php.windows (#16070) next »