2 SQL tables to produce alternating datables rows? Is this possible

2 SQL tables to produce alternating datables rows? Is this possible

monkeyboymonkeyboy Posts: 60Questions: 19Answers: 0

I have 2 identically structured tables in SQL. 1 is a table of budget items by project type. The 2nd is a table of multiple projects for each type, and the associated dollars spent per project. I want to display a table which has alternating rows thus:

Type1Budget Jan Feb Mar...
Type1Actuals Sum for Jan Sum for Feb sum for Mar...

Then 2 rows for type2 projects and so on.

Obviously, I can extract the data (in a php loop) for each SQL table, and use php to build the array for json

It just seems in-elegant.

Is there a clever way to handle this using the php library?
Alternately, can DataTables take a single JSON "row" and display it as 2 rows in the HTML?

Thanks for any thoughts on this!

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.