php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11923 when you access char(2000),i only get 255 bytes data, why ?
Submitted: 2001-07-06 05:14 UTC Modified: 2002-07-08 01:00 UTC
Votes:3
Avg. Score:4.0 ± 0.8
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: chenwumail at 163 dot net Assigned:
Status: No Feedback Package: MSSQL related
PHP Version: 4.0.5 OS: Windows2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: chenwumail at 163 dot net
New email:
PHP Version: OS:

 

 [2001-07-06 05:14 UTC] chenwumail at 163 dot net
when you access char(2000),i only get 255 bytes data, why ? 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-06 05:19 UTC] chenwumail at 163 dot net
My SQL Server is SQL Server 2000,
My PHP is PHP 4.05
My OS is windows 2000
My table name is news,defined like:

keyword varchar(2000),
content text

I can save data to keyword but when i get is ,it only 255 bytes, I view database, data is true save in table.


example:

$result=mssql_query("select keyword from news");
print strlent(mssql_result($result,0,0));

-------
255

 [2002-02-07 23:45 UTC] ollie at cronky dot net
Its to with the TDS protocol (used for connecting to MSSQL/Sybase) apparently.  On windows its out of date and therefore doesn't support more that 255 chars, you can use a convert statement (to convert the output of the column to text) or just change the datatype to text.

Or use the ODBC functions.
 [2002-06-07 11:02 UTC] k.schroeder@php.net
Does this working for you?
 [2002-07-08 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2002-08-07 02:49 UTC] mbretter at jawa dot at
not a bug in php, a bug in microsoft.

This is a limitation of the db-libraray of mssql.

Try select cast (keyword as text) from news
 [2004-01-07 11:00 UTC] Roland dot Grassmann at Jungheinrich dot de
It's not a bug, it's a feature...

Microsoft does not support access to any MS SQL Server >6.5 features by use of isql and db-library which seems to be used by php_mssql.dll.

See:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_mta_01_5cmk.asp

This means:
* no varchar etc with lengths > 255
* no unicode (ntext, nchar, nvarchar) fields.

If anyone finds a solution, please mail me!

Thanx,

Roland
 [2005-02-26 18:30 UTC] hollmanlp at gmail dot com
anyone found the solution????

thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Nov 26 23:01:33 2024 UTC