I got stuck with this, I want to select all the fields in 3 table while using GROUP_CONCAT. What I did is this but it return nothing.
SELECT
personnel.Task_id AS personnel_Task_id,
personnel.Top_id AS personnel_Top_id,
GROUP_CONCAT(personnel.Personnel) AS Personnel,
project.P_id AS project_P_id,
project.P_name, project.P_manager, project.POC,
project.TSD,
project.TED,
project.ASD AS project_ASD,
project.AED AS project_AED,
project.DT AS project_DT,
project.DA AS project_DA,
project.DV AS project_DV,
task.Task_id AS task_Task_id,
task.Top_id AS task_Top_id,
task.Task_name,
task.Frm,
task.todate,
task.ASD AS task_ASD,
task.AED AS task_AED,
task.P_id AS task_P_id,
task.DT AS task_DT,
task.DA AS task_DA,
task.DV AS task_DV,
task.Completion
FROM project_management.task,
project_management.project,
project_management.personnel
WHERE personnel.Task_id = task.Task_id
AND project.P_id = task.P_id
AND task.Top_id = '$oldID';
You need to use GROUP BY for group concat let me give an explanation
WHEN you use GROUP BY, you need to make all select columns compatible
it means you cant select a non grouped column.
You need to use group Aggregate functions at non-grouped columns
http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html
in this example table we cant select id directly
we can select MAX(id) MIN(id) AVG(id) …
Example Table
Query
RESULT