The following code is working perfectly :
$aColumns = array( "t.tablename", "r.book_hours",
"GROUP_CONCAT(CASE WHEN r.reserveday = CURDATE() THEN r.formtime ELSE NULL END ORDER BY r.formtime ASC) AS oldBookTime");
But when I add multiple fields from this tutorial StackTutorial
I edit the code become :
$aColumns = array( "t.tablename", "r.book_hours",
"GROUP_CONCAT(CASE WHEN r.reserveday = CURDATE() THEN r.formtime, '-', r.book_hours ELSE NULL END ORDER BY r.formtime ASC) AS oldBookTime");
It shows error:
Query error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' '-'
Is it I have to escape , '-',
? How to escape it?