Search code examples
sqlajaxdatatablesserver-side

Datatables alternative with SQL JOIN?


Firstly, apologies if this is in the wrong section as it's not a programming question.

Secondly, this is nothing against DataTables per se, I've used it a lot and I think it's really great.

I am working on a project that requires the capabilities of the DataTables library (most importantly the AJAX server side processing with search and pagination) but the databases I am working with have important data over separate tables and so I need to use an SQL JOIN statement to build my table.

The old version of DataTables had join capabilities hacked together by a community user but on the new version it's unfortunately only part of the paid DataTables Editor program - and as a student I am too poor to buy it lol

Is there an alternative (free) library out there that can offer the server-side processing with the filtering and pagination abilities of DataTables but can also handle the JOIN capabilities in building a table from an SQL statement?

Thank you very much!


Solution

  • I used Datatables free in my project before i had given up and just bought the editor. Anyway this method was time consuming but it worked.

    • For each sql, create a different php script which echo out the result.
    • Use datatables ajax populate and link your table to these php files. which runs a sql and echo out the result.
    • If you need to send data to sql add your variables in ajax request.
    • If you need to do secure stuff. User specific private data and such. You must use hashing and tokens and develop some kind of remote autorisation.(this is where i have given up but it can be done)