Friday, 9 August 2013

Set group_concat_max_len on a PDO query

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. I did as follows:
mysql_query("SET group_concat_max_len = 2048");
But using PDO not know how

No comments:

Post a Comment