How to push json to datatables from multiple seperate queries
How to push json to datatables from multiple seperate queries
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
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
Perfect! Thanks