From af94c4b2173bff419749e3f052485f1e451b40c1 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Thu, 7 Oct 2010 18:09:04 +0100 Subject: [PATCH] Updated: server-side processing example script updated to use json_encode, so this version will now require PHP 5.2 or newer. A version for older PHP versions can be found here: http://datatables.net/development/server-side/php_mysql4 --- .../examples_support/server_processing.php | 40 ++++++------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/examples/examples_support/server_processing.php b/examples/examples_support/server_processing.php index 4c447bd0..ccae1009 100644 --- a/examples/examples_support/server_processing.php +++ b/examples/examples_support/server_processing.php @@ -143,45 +143,31 @@ /* * Output */ - $sOutput = '{'; - $sOutput .= '"sEcho": '.intval($_GET['sEcho']).', '; - $sOutput .= '"iTotalRecords": '.$iTotal.', '; - $sOutput .= '"iTotalDisplayRecords": '.$iFilteredTotal.', '; - $sOutput .= '"aaData": [ '; + $output = array( + "sEcho" => intval($_GET['sEcho']), + "iTotalRecords" => $iTotal, + "iTotalDisplayRecords" => $iFilteredTotal, + "aaData" => array() + ); + while ( $aRow = mysql_fetch_array( $rResult ) ) { - $sOutput .= "["; + $row = array(); for ( $i=0 ; $i \ No newline at end of file