Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81729

Invalid JSON response.

$
0
0

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 )
);


Viewing all articles
Browse latest Browse all 81729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>