How to push json to datatables from multiple seperate queries

How to push json to datatables from multiple seperate queries

monkeyboymonkeyboy Posts: 60Questions: 19Answers: 0

I need to create a datatable which draws information from multiple SQL queries (NOT JOINS)
Essentially I need to run 3 queries to get the information, and will create my JSON array in memory.
HOW do I get that "pushed" to data table sing server side processing?

I will use this for initial table load, as well as an ajax response to a custom button (which will change the data source)

Essential I am building a summary table (similar to an excel pivot table) which will respond to "filter" changes.

The queries are not "joinable" as they constitute several independent queries which provide COUNT fields.
I do not clearly understand the Server side of the equation, as the examples all involve running the query within the server side methods.

Thanks

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin
    Answer ✓

    DataTables itself doesn't really "care" where the JSON comes from - for example if you have a JSON array in PHP you would just use echo json_encode( $myArray );.

    So basically you just need to have your server-side script result JSON.

    Allan

  • monkeyboymonkeyboy Posts: 60Questions: 19Answers: 0

    Perfect! Thanks

This discussion has been closed.