<?php 
  
    //In this example, we show how to connect FusionCharts to a database. 
  
    //For the sake of ease, we've used an MySQL databases containing two 
  
    //tables. 
  
  
  
    // Connect to the DB 
  
    $link = connectToDB(); 
  
  
  
   $strCategories = ""; 
  
   $strDataCurr = ""; 
  
   $strDataPrev = ""; 
  
    $strDataPc = ""; 
  
  
  
    //$strXML will be used to store the entire XML document generated 
  
    //Generate the chart element 
  
    $strXML = ""; 
  
  
  
  // Fetch all factory records 
  
    $strQuery = "select * from form_results";	 
  
    $result = mysql_query($strQuery) or die(mysql_error()); 
  
  
  
  
  
    //Iterate through each factory 
  
    if ($result) { 
  
        while($ors = mysql_fetch_array($result)) { 
  
  
  
  
  
    $strCategories .= ""; 
  
    $strDataCurr .= ""; 
  
    $strDataPrev .= ""; 
  
    $strDataPc .= ""; 
  
  
  
  
  
  
  
    } 
  
  
  
                   } 
  
  
  
    mysql_close($link); 
  
$strCategories .= ""; 
  
$strDataCurr .= ""; 
  
   $strDataPrev .= ""; 
  
   $strDataPc .= ""; 
  
$strXML .= $strCategories . $strDataCurr . $strDataPrev . $strDataPc . ""; 
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
echo renderChart("../../FusionCharts/MSColumn3D.swf", "", $strXML, "productSales", 600, 300, false, false); 
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
?> 
  
  
  
  
  
  
  
  
  
 
Delete Last Entry