Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more - View Single Post - PHPlot and Arrays
View Single Post
Old 06-26-2009, 08:20 AM   #2 (permalink)
dave.albert
Junior Member
 
Join Date: Jun 2009
Posts: 1
Default Re: PHPlot and Arrays

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 View Post
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
dave.albert is offline   Reply With Quote
Sponsored Links