mssql_fetch_object 文本字符限制?

mssql_fetch_object text character limit?(mssql_fetch_object 文本字符限制?)
本文介绍了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 文本字符限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Convert JSON integers and floats to strings(将JSON整数和浮点数转换为字符串)
in php how do I use preg replace to turn a url into a tinyurl(在php中,如何使用preg替换将URL转换为TinyURL)
all day appointment for ics calendar file wont work(ICS日历文件的全天约会不起作用)
trim function is giving unexpected values php(Trim函数提供了意外的值php)
Basic PDO connection to MySQL(到MySQL的基本PDO连接)
PHP number_format returns 1.00(Php number_Format返回1.00)