I'm still very new in PhP, and I have this statement here:
SET @sql = NULL;
SELECT
GROUP_CONCAT(DISTINCT
CONCAT(
'GROUP_CONCAT(CASE WHEN `Date` = ''',
`Date`,
''' THEN hours ELSE NULL END) AS `',
`Date`, '`'
)
) INTO @sql
FROM Days;
SET @sql = CONCAT('SELECT Name, ', @sql,'
FROM Days
GROUP BY Name
');
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
and I'm trying to execute it with Php so I have the same html table like in this fiddle: