<?php
include ("db/Config.php");
// write your SQL query here (you may use parameters from $_GET or $_POST
if you need them)
$query = mysql_query('select b.ifbook as Book,sum(a.amt) as Amount from
mtrans a JOIN ifsc b on b.ifscd=a.ifsc and orgdate between "20131001" and
"20131031" group by Book');
$table = array();
$table['cols'] = array(
/* define your DataTable columns here
* each column gets its own array
* syntax of the arrays is:
* label => column label
* type => data type of column (string, number, date, datetime, boolean)
*/
array('label' => 'Book', 'type' => 'string'),
array('label' => 'Amount', 'type' => 'number'),
// etc...
);
$rows = array();
while($r = mysql_fetch_assoc($query)) {
$temp = array();
// each column needs to have data inserted via the $temp array
$temp[] = array('v' => $r['Book']);
$temp[] = array('v' => $r['Amount']);
// etc...
// insert the temp array into $rows
$rows[] = array('c' => $temp);
}
// populate the table with rows of data
$table['rows'] = $rows;
// encode the table as JSON
$jsonTable = json_encode($table);
// return the JSON data
echo $jsonTable;
?>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.