I am writing a script which will counts the number of ticket as per as different conditions and store the count in a summary table. I am unable to understand how to structure my
Wrong approach. Do not splay an array across columns. Instead have rows for the data. This lets you trivially "add" another month.
For displaying, well that is an application problem, no a MySQL problem. Sure, you can write specialized queries to "pivot" the data from rows to columns, but it is messy.