amending server-side script to allow the data source to be an SQL query on a table?
amending server-side script to allow the data source to be an SQL query on a table?
elynch
Posts: 3Questions: 1Answers: 0
How would I go about amending server-side script (eg http://www.datatables.net/examples/data_sources/server_side.html) to allow the data source to be an SQL query on a table (or table join)?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The server-side example is already using a SQL query on a table.
http://datatables.net/examples/data_sources/server_side.html
If your observation is correct I should be able to replace
// DB table to use
$table = 'datatables_demo';
with
$sqlstr = "Select ..."; // my query definition (possibly including a join to a linked table)
$table = $sqlstr;
Will test this and see how the changes behave.
Setting $table to an SQL query resulting in the diagnostic -
1103 Incorrect table name 'SELECT
Why would you do that? The $table variable obviously requires a table name.
Currently no - you cannot use a sub-select in the SSP PHP class. If you want to do that you would need to modify the SSP class.
Allan