It looks like your SQL query is not returning any rows.

On Sunday, November 10, 2013 11:29:17 PM UTC-5, mani wrote:
>
> still i get the empty result,any suggestions
>
>
> {"cols":[{"label":"Book","type":"string"},{"label":"Amount","type":"number"}],"rows":[]}
>
>
>
>
>
>
>
> On Saturday, 9 November 2013 22:56:25 UTC+5:30, asgallant wrote:
>>
>> That looks good, except you have an errant comma at the end of this line:
>>
>> array('label' => 'Amount', 'type' => 'number'), <-- this comma needs to 
>> be deleted
>>
>> Remove the comma and try again.
>>
>> On Saturday, November 9, 2013 1:53:55 AM UTC-5, mani wrote:
>>>
>>> <?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.

Reply via email to