[英]Set group_concat_max_len on a PDO query
I have the following query: 我有以下查询:
$cases = $conn->prepare("SELECT GROUP_CONCAT(text SEPARATOR '|') as texts, year FROM cases GROUP BY year ORDER BY ano DESC");
$cases->execute();
$cases_result = $cases->fetchAll(PDO::FETCH_OBJ);
But some texts are not showing completely 但有些文字并未完全显示
So I have to change the value of group_concat_max_len. 因此,我必须更改group_concat_max_len的值。 I did as follows:
我做了如下:
mysql_query("SET group_concat_max_len = 2048");
But using PDO not know how 但是使用PDO不知道如何
你不能使用$conn->query()
吗?
$conn->query("SET group_concat_max_len = 2048");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.