this is my cod, there is any error but when i test it my page web a empty
???????
<?php
pg_connect("host=localhost port=5432 dbname=base_test user=postgres
password=123456") or die('Could not connect: ' . pg_last_error());
$q='SELECT "Facteur","building" from "Cout" where site=\'Montmorin\'';
$query=pg_query($q);
$n=pg_num_rows($query);
?>
<html>
<head>
<script type="text/javascript"
src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['building', 'Facteur'],
<?php
for($i=0; $i<$n; $i++)
{
$f=pg_fetch_row($query);
echo("['".$f[1]."', ".$f[0]."]");
}
?>
]);
var options = {
title: 'My Daily Activities'
};
var chart = new
google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
</head>
<body>
<div id="chart_div" style="width: 900px; height: 500px;"></div>
</body>
</html>
--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.