Set group_concat_max_len to a PDO request

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 do not appear completely

Therefore, I need to change the value of group_concat_max_len. I have done the following:

 mysql_query("SET group_concat_max_len = 2048"); 

But using PDO doesn't know how

+6
source share
1 answer

Can't you use $conn->query() ?

 $conn->query("SET group_concat_max_len = 2048"); 
+10
source

Source: https://habr.com/ru/post/951413/


All Articles