How to link with below sql into php code and how to display this out put in html table formate?

#1

SELECT DATE(date),
SUM( IF( DAY(date) = 1, cash, 0) ) AS MON,
SUM( IF( DAY(date) = 2, cash, 0) ) AS february,
SUM( IF( DAY(date) = 3, cash, 0) ) AS march,
SUM( cash ) AS total
FROM daily_datas
GROUP BY date

#2

no idea what you want

1 Like
#3

maybe you just dive in into PDO for querying a database

https://www.php.net/manual/en/book.pdo.php

and then you can just use echo

https://www.php.net/manual/en/function.echo.php

to generate any HTML.