PHP 和 mssql 库可以从 varchar 列中选择超过 256 个字符吗? [英] Can PHP and mssql library select more than 256 characters from a varchar column?

查看:29
本文介绍了PHP 和 mssql 库可以从 varchar 列中选择超过 256 个字符吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有解决方法(除了将列类型更改为文本字段)来使用 PHP 和 mssql 库选择大型 varchar 字段?例如 varchar(500).PHP 真的将字符数限制为 255 个吗?有没有比这更多的方法?

Is there a work around (other than changing the column type to a textfield) for SELECTing a large varchar field using PHP and mssql library? For instance a varchar(500). Does PHP really restrict the number of characters to 255? Is there a way to pull back more than that?

推荐答案

从 PHP 页面来看,问题似乎是 Windows 平台上的底层数据库驱动程序.Varchar 只能返回 <255 个字符.解决方法是在 sql SELECT 语句中将 varchar 转换为文本.

From the PHP page, the problem seems to be the underlying database driver on Windows platforms. Varchar can only return < 255 characters. The work around is to cast the varchar to text within the sql SELECT statement.

这篇关于PHP 和 mssql 库可以从 varchar 列中选择超过 256 个字符吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆