0

I need to get a HTML Table in matrix form from this query:

SELECT category,
       entrydate,
       SUM(effortext+effortself)
FROM entries
WHERE YEAR(entrydate) = '2016'
GROUP BY category, month(entrydate)
ORDER BY category ASC

As Result I get something like:

category    entrydate   value
CAT1    2016-02-01  1051
CAT1    2016-03-01  903
CAT1    2016-04-01  869
CAT1    2016-05-02  546
CAT1    2016-06-01  486
CAT1    2016-07-01  530
CAT1    2016-08-01  604
CAT1    2016-09-01  639
CAT1    2016-10-04  879
CAT1    2016-11-01  1548
CAT1    2016-12-05  242
CAT2    2016-01-04  615
CAT2    2016-02-01  673
CAT2    2016-03-01  687
CAT2    2016-04-01  435
CAT2    2016-05-02  416

I need this data to be displayed as HTML Table using php, but I don't know how to start. For my database connection and queries I got procedural mysqli. Like mysqli_query()

category   Jan       Feb        Mar      Apr       May      Jun         Jul       Aug     Sep        Oct         Nov        Dec
CAT1        0          1051       903       869     546        ...
CAT2        ...
CAT3
...
J3STER
  • 1,027
  • 2
  • 11
  • 28
phpDev937
  • 3
  • 3

0 Answers0