Passing Field Names to MySQL Crosstab Stored Procedures
Rob Gravelle demonstrates a solution for passing MySQL dynamic field names to the group_concat function using a combination of stored proc input parameters, string concatenation, and prepared statements.