|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-01-14 18:39 UTC] cmb@php.net
[2020-12-10 11:37 UTC] nikic@php.net
-Status: Open
+Status: Not a bug
[2020-12-10 11:37 UTC] nikic@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 10:00:01 2025 UTC |
Description: ------------ Hello. There is a bug in PDO's MySQL driver. It is necessary to write SQL query like this: SELECT GROUP_CONCAT( title SEPARATOR '\'' ) FROM `tblNews` GROUP BY `date` I bind value to the separator by PDO but it doesn't work. Test script: --------------- <?php // ... $this->connection = new PDO('mysql:host=' . $configurations['host'] . ';dbname=' . $configurations['database'] . '; charset=utf8', $configurations['user'], $configurations['password']); $sth = $this->connection->prepare("SELECT GROUP_CONCAT( title SEPARATOR ? ) FROM `tblNews` GROUP BY `date`"); $sth->bindValue(1 , ':'); $sth->execute(); var_dump($sth->fetch());