关于PHP读取sql server 7的TEXT型字段时,只能读出4KB

yuanyingtanxi 2000-09-11 08:53:00
请教各位高手:
主机环境:NT4 + SP6 + SQL SERVER 7.0 + PHP3
sql server 表中TEXT类型的字段,用PHP3读取时放到数组mssql_fetch_array、放入行mssql_fetch_row、放入对象mssql_fetch_object时只能放入4kb
而在数据库中,字段的内容确实大于4kb,(用导出到别的类型的数据库可以看到).
请问是不是PHP的数组或对象只能支持4kb,而不能更大,请问如何才能读出大于4kb的内容。
本人不吝分数,请高手指教,小弟十万火急。
------------------------------------------
原应叹息
...全文
296 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
ipman 2000-09-18
  • 打赏
  • 举报
回复
关注
yuanyingtanxi 2000-09-18
  • 打赏
  • 举报
回复
谢谢大家的帮助与关心,The_east_key请到http://expert.csdn.net/TopicView.asp?id=30347领分
yuanyingtanxi 2000-09-18
  • 打赏
  • 举报
回复
哈哈我终于找到解决的办法了.

the mssql module uses two parameters in php3.ini to control the size and
limit of text columns.

mssql.textsize = 4096 (0-64kb)
mssql.textlimit = 4096 (0-2Gb)

try setting one or both params.

The max total length of a row on MSSQLServer 6.5 is 1738 or so chars
(~8100 on 7.0). If you are inserting into a BLOB (VARCHAR or VARBINARY)
you have to issue a set textsize=(up to 32768 or whatever the max
configured in the SQLServer) statement to tell it the maximum amount you
will transfer at a time. Plus you have to do an insert on the row where
the blob is to be stored and then a select to get the textpointer for
the just inserted row followed by a writetext loop to insert the actual
data. You end up assembling a series of writetext statements with
offsets, lengths, and data in the servers buffer then hit it with an
execute. It is not real clean but we do it all the time in production.
Have been using the same code since 4.21.08. It came out in the
SQLServer programmers toolkit as a VB image insert/read example.

但是各位,我不知道如何给分了,只有The_east_key回复的差不多

yuanyingtanxi 2000-09-18
  • 打赏
  • 举报
回复
求助
yuanyingtanxi 2000-09-15
  • 打赏
  • 举报
回复
呵呵,这种方法当然不行,如果我的内容有1m呢,我岂不是要建256个字段。
高手们,哪里去了。
有英文好的朋友帮忙去www.php.net问问,我实在是英文不好,不然我就自已去问了。
flyby 2000-09-15
  • 打赏
  • 举报
回复
我又一个笨方法:
你用两个TEXT类型的字段来存你的信息,不让它超出4k,
操作就没问题了!
yuanyingtanxi 2000-09-15
  • 打赏
  • 举报
回复
求助
canbo 2000-09-14
  • 打赏
  • 举报
回复
关注
The_east_key 2000-09-13
  • 打赏
  • 举报
回复
我曾经碰到过,经过琢磨,现如下解决:
修改php.ini
[ODBC]
uodbc.defaultlrl=64000 ;4k=4096,我用了64k,呵呵,不能再大了。不知道够不够用。呵呵。

我的cclovesxm@263.net
yuanyingtanxi 2000-09-13
  • 打赏
  • 举报
回复
re:hicaci
[MSSQL]段里并没有defaultlrl这项,我自已加上mssql.defaultlrl=64000后也是不行
还有我用的是ms sql而不是mysql
请The_east_key方便的话留下电话,或OICQ号码,我想和你联系向你请教
我的OICQ是16980471,欢迎朋友们指点.
我实在是太着急了。
谢谢大家了

hicaci 2000-09-13
  • 打赏
  • 举报
回复
我以前学过php3,如果the_east_key
的做法事对的话,对应的也有mysql选项--对应改就行了。
也在php.ini理头。
yuanyingtanxi 2000-09-13
  • 打赏
  • 举报
回复
终于等到有人回答了,先谢谢你
不过这种方法不行呀,我在PHP3和php4下都试了,都不成
我用的连接方式不是ODBC,而是用mssql_connect,这个函数所连接到的数据库和设置ODBC部分有关系么。
yuanyingtanxi 2000-09-12
  • 打赏
  • 举报
回复
执分在手,问天下谁是英雄

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧