Skip to content
Advertisement

PHP: Line break is not working in data table using MYSQL?

Hi I have data in my MYSQL which I am trying to sort by Months and Year together and display it in new HTML table every time sort by Year and months.

trying to do like this –

JavaScript

(Months wise data)

But HTML table is sorted by year only not months. see below the output.

enter image description here

But I am trying to make it like this January 2021 data is different table and OKT = October 2021 data in new table like below image enter image description here

Here is my PHP CODE –

JavaScript

Advertisement

Answer

do comparison between months not years and get month from DB also break line and add new line only when month change

Update query

JavaScript

update code

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement