Invalid JSON response.
Invalid JSON response.

DataTables warning: table id=example - Invalid JSON response.
$table = 'products1';
$primaryKey = 'product_id';
$columns = array(
array( 'db' => 'pname', 'dt' => 'pname' ),
array( 'db' => 'cat', 'dt' => 'cat' ),
array( 'db' => 'color', 'dt' => 'color' ),
array( 'db' => 'size', 'dt' => 'size' ),
array(
'db' => 'date_arrival',
'dt' => 'date_arrival',
'formatter' => function( $d, $row ) {
return date( 'jS M y', strtotime($d));
}
),
array(
'db' => 'price',
'dt' => 'price',
'formatter' => function( $d, $row ) {
return '$'.number_format($d);
}
)
);
// SQL server connection information
$sql_details = array(
'user' => 'root',
'pass' => '',
'db' => 'smart',
'host' => 'localhost'
);
require( 'ssp.class.php' );
echo json_encode(
SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns )
);
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Answers
pls what have i done wrong....

What is the response from the server. The tech note that the error message links to shows how to get that information.
Allan
when i try loading table, i don't know if i've done something wrong, in the server_processing.php i followed the tutorial too, i keep getting error
DataTables warning: table id=example - Invalid JSON response.
Did you follow the troubleshooting steps at the link provided in the error?
https://datatables.net/manual/tech-notes/1
What did you find?
Kevin