1有一个MySQL表类型“文本”的列“full_description”。 该列是一个标准的Lorem存有(加字结尾):PHP MySQL的选择文本截断
Lorem存有胡萝卜,番茄 回扣和给活力的精力和时间occaecat 肥胖。多年来所有 会我来了,我可以aliquip刺激措施,如果学区谁出她的 nostrud锻炼,配方的 优势。 DUIS目前有cillum cupidatat 希望找疼痛足球的乐趣逃离 不产生合力的痛苦。他们不是excepteur excepteur cupidatat 百叶窗,还有 是舒缓的灵魂,即有过错,他们抛弃了那些谁的一般职责,从你的烦恼。结束
然而,在PHP中做一个选择它的时候,它只能检索这么多:
Lorem存有胡萝卜, 增强回扣,但他们 occaecat时间和活力,如劳动力和 肥胖。多年来所有 会我来了,我可以aliquip刺激措施,如果学区谁出她的 nostrud锻炼,配方的 优势。家庭作业,如果cupidatat 疼我
下面是检索它的PHP代码,
function getPostingDetails($posting_id){
$getPosting = $this->PLAST->prepare('SELECT posting_id, poster_id, title, short_description, full_description FROM postings WHERE posting_id=?');
$getPosting->bind_param('i',$posting_id);
$getPosting->execute();
$getPosting->bind_result($row['posting_id'],$row['poster_id'],$row['title'],$row['short_description'],$row['full_description']);
$getPosting->fetch();
$getPosting->close();
return $row;
}
这是数组1 GET:
Array ([posting_id] => 1 [poster_id] => 1 [title] => Test 1 [short_description] => This is a short description. [full_description] => Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor i)
领域的其余部分都很好。 1 我究竟做错了什么?或者是有限制的select语句1'm没有意识到设置或功能?在MySQL?在PHP MySQL的?
感谢
这是根据请求表结构:
CREATE TABLE `postings` (
`posting_id` int(11) NOT NULL AUTO_INCREMENT,
`poster_id` int(11) NOT NULL,
`title` tinytext NOT NULL,
`short_description` tinytext NOT NULL,
`full_description` text NOT NULL,
PRIMARY KEY (`posting_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
你能后的表定义? SELECT返回的文本有256个字符。你没有任何限制吗?另一件事:你如何将数据插入数据库? – 2009-10-02 21:39:15
我刚刚添加它。 我没有看到,其中,极限将是...请注意,在phpMyAdmin中,full_description完全显示。所以它被正确保存。在执行SELECT时截断。 – 2009-10-02 21:41:54
你使用的是什么框架?我认为这是对TEXT数据类型的一些默认限制。 – 2009-10-02 21:48:59