Try something like
PHP Code:
$data = array();
$num = 0;
while ($row = mysql_fetch_assoc($result))
{
$data[$num] = array($row["ins_group"],$row["los"]);
$num += 1;
}
Quote:
Originally Posted by andymsuk
Hi everyone.
I'm using PHPlot to draw graphs. Hopefully you are familiar with PHPlot.
PHP Code:
while($row = mysql_fetch_array($sql))
{
$count = $count + 1;
$Date = $row['Date'];
$Mark = $row['Mark'];
$blah = array('', $Date, $Mark);
$graphdata[$count] = $blah;
};
$data = array($graphdata); //This bit is obviously instead of the example given above.
However, this doesn't seem to work and the graph image just returns the "corrupt image" X icon.
Can anyone spot what is wrong with my code or the right way to do it, please?
Thanks in advance.
Andy
|