Sql group by function
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        


««12

Sql group by function Expand / Collapse
Author
Message
Posted 11/23/2007 1:55:35 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 11/24/2007 4:04:22 PM
Posts: 7, Visits: 15
It just displays: no data to display
Post #3141
Posted 11/23/2007 11:09:04 PM
FusionCharts Team

FusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts Team

Group: Administrators
Last Login: Yesterday @ 8:20:12 AM
Posts: 2,194, Visits: 521
Hi,

Can you make sure that your XML has some data elements?


Thanks,
Pallav Nadhani
FusionCharts Team
Post #3158
Posted 11/24/2007 2:35:43 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 11/24/2007 4:04:22 PM
Posts: 7, Visits: 15
Here is the code, still the same result, no data to display...

//We've included ../Includes/DBConn.php, which contains functions
//to help us easily connect to a database.
include("../Includes/DBConn.php");

//This page generates the XML data for the Pie Chart contained in
//Default.php.

//For the sake of ease, we've used an MySQL databases containing two
//tables..

//Connect to the DB
$link = connectToDB();

//$strXML will be used to store the entire XML document generated
//Generate the graph element
$strXML = "<graph caption='Factory Output report' subCaption='By Quantity' decimalPrecision='0' showNames='1' numberSuffix=' Units' decimalPrecision='0'

pieSliceDepth='30'>";
// Fetch all factory records
$strQuery = "select Distinct Year(newsdate) as Years from visits";
$result = mysql_query($strQuery) or die(mysql_error());

//Iterate through each factory
if ($result) {
while($ors = mysql_fetch_array($result)) {
//Now create a second query to get details for this factory
$strQuery = "select Year(newsdate) as SYear, count(newsdate) as TotOutput from visits where Year(newsdate)<=" . $ors['Years'];
$result2 = mysql_query($strQuery) or die(mysql_error());
$ors2 = mysql_fetch_array($result2);
//Generate
$strXML .= "<set name='" . $ors2['SYear'] . "' value='" . $ors2['TotOutput'] . "' />";
//free the resultset
mysql_free_result($result2);
}
}
mysql_close($link);

//Finally, close element
$strXML .= "
";

//Set Proper output content-type
header('Content-type: text/xml');

//Just write out the XML data
//NOTE THAT THIS PAGE DOESN'T CONTAIN ANY HTML TAG, WHATSOEVER
echo $strXML;
?>
Post #3169
Posted 11/27/2007 4:30:07 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Today @ 5:38:52 AM
Posts: 884, Visits: 1,420
can you get the proper XML output...try opeing this dataURL file separately in browser from localhost/server (wahtever) and see if the XML is generated ok...if yes then try setting the debugging mode ON and see whats the problem....

make sure you are passing this URL not as dataXML but as dataURL

Regards,

Sudipto Choudhury
FusionCharts Team

Post #3182
« Prev Topic | Next Topic »

««12

Permissions Expand / Collapse

All times are GMT -7:00, Time now is 6:25pm


Execution: 0.094.