hi my friend i´ve finished this. my result file json is this:
{"cols":[{"label":"word of mouth
recomendation","type":"number"},{"label":"magazine
advertisement","type":"number"},{"label":"roadside
advertisement","type":"number"}],"rows":[{"c":[{"v":"2"}]},{"c":[{"v":"1"}]},{"c":[{"v":"1"}]}]}
i hope that this be the correct result......
look my php file:: my php file is this
:
<?php
$var1="$_POST[fecha1]";
$var2= "$_POST[fecha2]";
$server="localhost";
$username="root";
$password="chrystopher";
$databasename="encuestasavandaro";
$con= mysql_connect($server,$username,$password)
or die('Error connecting to server');
mysql_select_db($databasename,$con);
$query= mysql_query("select count(b.id_respuesta) from huesped a,
rompe_encuesta b
where
b.id_huesped=a.id_huesped and b.id_aspecto=1 and b.id_respuesta=8 and
a.fecha between '$var1' and '$var2';");
$query2= mysql_query("select count(b.id_respuesta) from huesped a,
rompe_encuesta b
where
b.id_huesped=a.id_huesped and b.id_aspecto=1 and b.id_respuesta=9 and
a.fecha between '$var1' and '$var2';");
$query3= mysql_query("select count(b.id_respuesta) from huesped a,
rompe_encuesta b
where
b.id_huesped=a.id_huesped and b.id_aspecto=1 and b.id_respuesta=10 and
a.fecha between '$var1' and '$var2';");
$table = array();
$table['cols']=array(
array('label' => 'word of mouth recomendation'
, 'type'=>'number'),
array('label' => 'magazine advertisement'
, 'type'=>'number'),
array('label' => 'roadside advertisement'
, 'type'=>'number')
);
$rows = array();
while($r= mysql_fetch_assoc($query)){
$temp = array();
$temp[]=array('v' => $r['count(b.id_respuesta)']);
$rows[] = array('c' => $temp);
}
while($r= mysql_fetch_assoc($query2)){
$temp = array();
$temp[]=array('v' => $r['count(b.id_respuesta)']);
$rows[] = array('c' => $temp);
}
while($r= mysql_fetch_assoc($query3)){
$temp = array();
$temp[]=array('v' => $r['count(b.id_respuesta)']);
$rows[] = array('c' => $temp);
}
$table['rows']=$rows;
$jsonTable= json_encode($table);
echo $jsonTable;
?>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
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.