CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 XML output for FlashChart

Print topic Send  topic

Author Message
jokecoat

Posts: 43
Posted: 06/14/2011, 2:54 AM

Hi,

I'm using this (http://forums.codecharge.com/posts.php?post_id=91164) code to generate a XML file for FlashChart. But now i want to link it to the outcome of grid1.

The SQL of grid1 is:

SELECT jaar, maand, avg(totaal) AS gem FROM vw_ronde_totaal WHERE speler_id = {Expr0} AND baan_id = {Expr1} GROUP BY jaar, maand ORDER BY datum

and the code for XML output is
$db = new clsDBlocalhost();   
$strQuery ="SELECT jaar, maand, Avg(totaal) AS gem FROM vw_ronde_totaal WHERE speler_id = 9 AND baan_id = 1 GROUP BY jaar, maand ORDER BY datum ASC" ;   
$db->query($strQuery);   
$rows=$db->num_rows($db->f("jaar")); //get number of rows returned by the query   
$Array1=array();   
$Array2=array();   
$i=0;   
while($db->next_record())   
{   
$Array1[$i] = $db->f("maand");   
$Array2[$i] = $db->f("gem");   
$i++;   
}   
$strXML ="<chart><chart_data><row><null/>"; // xml generation   
for($i=0;$i<$rows;$i++) $strXML.="<string>".$Array1[$i]."</string>";   
$strXML.="</row><row><string></string>";   
for($i=0;$i<$rows;$i++) $strXML.="<number>".$Array2[$i]."</number>";  
// The xml string has been constructed.. We now dump this string into a XML file    
    
	$myfile="example.xml";    
	$myfilehandle= fopen($myfile, 'w') or die("can't open file");    
	fclose($myfilehandle);    
    
	$fh = fopen($myfile, 'w') or die("can't open file");    
	fwrite($fh, $strXML);    
	fclose($fh);    
    
	$db->close();


How can i get the grid1 output in the code for the XML output?
View profile  Send private message
jokecoat

Posts: 43
Posted: 06/14/2011, 7:51 AM

Or in other words: how can i use expr0 and expr1 in the sql for the chart (must be the same as the grid)

expr0: player_id = CCGetUserId() (expression)
expr1: course_id = s_course_id (url)
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.