use $_GET variable on Editor::inst( $db, $sql_table, 'ID' )
use $_GET variable on Editor::inst( $db, $sql_table, 'ID' )

Hello gurus, i need some help:
I have a variable on my URL call 'table' how i can passes to the local variable $sql_table for using on
Editor::inst( $db, $sql_table, 'ID' )
i try with: $sql_table = $_GET['table']; bus doesnt work: it bring me this error:
DataTables warning: table id=mant_dm - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1
how i can use $_GET??
my code:
<?php
// DataTables PHP library and database connection
include( "lib/DataTables.php" );
// Alias Editor classes so they are easy to use
use
DataTables\Editor,
DataTables\Editor\Field,
DataTables\Editor\Format,
DataTables\Editor\Mjoin,
DataTables\Editor\Options,
DataTables\Editor\Upload,
DataTables\Editor\Validate,
DataTables\Editor\ValidateOptions;
//$sql_tabla = $_GET['table'];
//$sql_tabla = 'test_table';
$sql_tabla = $db->quote( $_GET['table']);
Editor::inst( $db, $sql_tabla, 'ID' )
->fields(
Field::inst( 'Field1' ),
Field::inst( 'Field2' )
)
->process( $_POST )
->json();
This discussion has been closed.
Replies
Duplicate of this thread - please don't repeat threads.
@colin your thread its this same page
I meant this one: https://datatables.net/forums/discussion/59023/use-get-variable-on-editor-inst-db-sql-table-id#latest