Please excuse my newbie Question.
I'm tryin to display data from a mysql table into a chart (phpChart http://phpchart.net) What I need is to display all values of Field cost for Region 'CA'
E.g
ID Cost Region
----------
1 500 CA
----------
2 100 DP
----------
3 280 CA
----------
4 40 ST
----------
5 80 CA
----------
<?php
include 'config.php';
$query = "SELECT Cost From tblForecast where Region='CA' =";
$rs = mysql_query($query);
if (!$rs) {
echo "Could not execute query: $query";
trigger_error(mysql_error(), E_USER_ERROR);
} else {
echo "Query: $query executed
";
}
$nrows = mysql_num_rows($rs);
for ($i = 0; $i < $nrows; $i++) {
$row = mysql_fetch_row($rs);
echo $row[0];
echo "<br/>";
}
$pc = new C_PhpChartX(array(array($row[0])),'basic_chart');
\\"This where i'm stuck as to how display the other values within the array"
$pc->set_title(array('text'=>'Basic Chart with Bar Renderer'));
$pc->set_series_default(array('renderer'=>'plugin::BarRenderer'));
$pc->draw();
mysql_close();
?>
I'm able to display the first rows value in the chart only.
Anyone's help would be much appreciated Thanks in advance