thanks for the reply ..
the query im using in phpmyadmin showing 55 records: SELECT planta,
capacidadMW FROM planta;
the code using to encode using JSon (result is only 14 records):
<?php
include('connect-db.php');
$sth = mysql_query("SELECT planta, capacidadMW FROM planta");
$rows = array();
$flag = true;
$table = array();
$table['cols'] = array(
array('label' => 'planta', 'type' => 'string'),
array('label' => 'capacidad en MW', 'type' => 'number')
);
$rows = array();
while($r = mysql_fetch_assoc($sth)) {
$temp = array();
$temp[] = array('v' => (string)$r['planta']);
$temp[] = array('v' => (int) $r['capacidadMW']);
$rows[] = array('c' => $temp);
}
$table['rows'] = $rows;
$jsonTable = json_encode($table);
echo $jsonTable;
?>
On Wednesday, December 12, 2012 10:55:45 AM UTC-6, asgallant wrote:
>
> At a guess, I would say you have an error in the SQL in PHP. If you post
> your PHP code, I'll take a look at it.
>
> On Wednesday, December 12, 2012 11:41:25 AM UTC-5, Ian Haylock wrote:
>>
>> Hi asgallant, thank you very much for th taking the time to help others.
>> i have a question if you dont mind, i followed Diana´s sample and got it to
>> work, well sort of, i used my onw db and managed to show the graph and
>> everithing, the only thing is that my mysql query running in phpmyadmin
>> shows 55 records and my json result shows only 14 records, how is that
>> possible ???
>>
>> On Wednesday, December 12, 2012 12:54:06 AM UTC-6, Chrystopher Medina
>> wrote:
>>>
>>>
>>> ok im gonna start with the php information. and u know i have another
>>> problem how i cant charge two pie charts in the same place but each with
>>> different results.... u know i have two questions and i want to charge the
>>> results from them. in two pie charts..... because i read that just one pie
>>> chart can be charged in the same place.... i could be mistaken
>>
>>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-visualization-api/-/H2pPyg6Rk3YJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.