mssql_fetch_object 文本字符限制? [英] mssql_fetch_object text character limit?

查看:24
本文介绍了mssql_fetch_object 文本字符限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 mssql_fetch_object 从 MSSQL 表中获取一些数据,但页面上的文本似乎被截断了.

I'm fetching some data from an MSSQL table using the mssql_fetch_object, but the text appears to cut off on the page.

数据都在表格中,但在视图页面中似乎被截断了.

The data is all there in the table, but it seems to cut off in the view page.

有没有其他人遇到过这个问题并且可能知道解决方法?这是我的代码;

Has anyone else encountered this problem and perhaps knows of a workaround? Here is my code;

<?php include('includes/session.php');
$query = "SELECT content FROM pages WHERE id = '11'";
$result = mssql_query($query);
$page = mssql_fetch_object($result);
?>

<div id="leftcol">
<?php echo stripslashes($page->content) ?>
</div>

推荐答案

我不熟悉在php中使用mssql,但是我只是尝试了一个使用mysql的例子,没有问题.

I'm not familiar with using mssql in php, but I just tried an example using mysql without problem.

我觉得这很可疑

VAR_DUMP() 返回字符串(4096)

VAR_DUMP() returned string(4096)

所以我做了一些谷歌搜索并找到了这个链接

so I did some googling and found this link

http://www.bram.us/2007/07/05/my-dotd-ms-sql-vs-php-4096-is-the-default-limit/

建议将 php.ini 中的 mssql.textlimit 和 mssql.textsize 更改为 1048576(即 2^20),默认为 4096.希望对您有所帮助.

It suggests to change mssql.textlimit and mssql.textsize to 1048576 (which is 2ˆ20) in your php.ini as the default is 4096. Hope that helps.

php.ini

  ; Valid range 0 - 2147483647.  Default = 4096.
  mssql.textlimit = 1048576
  ; Valid range 0 - 2147483647.  Default = 4096.
  mssql.textsize = 1048576

这篇关于mssql_fetch_object 文本字符限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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