|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 4/1/2008 5:58:27 AM
Posts: 3,
Visits: 5
|
|
| Hi, I'm beginner with FusionCharts, trying to make Pie chart from few boolean (TINYINT) fields in MySQL database. I'm using PHP dataXML method and getting strange return from query [ code ] <?php
include("../Includes/FusionCharts.php"); include("../Includes/DBConn.php"); ?> <HTML> <HEAD> <TITLE>FusionCharts - Database Example</TITLE> <SCRIPT LANGUAGE="Javascript" SRC="../FusionCharts/FusionCharts.js"></SCRIPT> </HEAD> <BODY> <CENTER> <?php
$link = connectToDB(); $strXML = "<chart caption='Ciastko z checków 13' subCaption='Ilosci' pieSliceDepth='30' showBorder='1' formatNumberScale='0' numberSuffix=' sztuk'>"; $strQuery = "select count(a_check13) from test01.formret where a_check13 = '0'"; $a_check13_0 = mysql_query($strQuery) or die(mysql_error()); $strQuery = "select count(a_check13) from test01.formret where a_check13 = '1'"; $a_check13_1 = mysql_query($strQuery) or die(mysql_error()); //Generate <set label='..' value='..'/> $strXML .= "<set label='Nie' value='" . $a_check13_0 . "'/>"; $strXML .= "<set label='Tak' value='" . $a_check13_1 . "'/>"; mysql_close($link); $strXML .= "</chart>"; //Create the chart - Pie 3D Chart with data from $strXML echo renderChart("../FusionCharts/Pie3D.swf", "", $strXML, "FactorySum", 600, 300, "1", false, false); ?> </BODY> </HTML> [/ code ] ... and the return is below
INFO: XML Data provided using dataXML method. XML Data: <chart caption="Ciastko z checków 13" subCaption="by procent" pieSliceDepth="30" showBorder="1" formatNumberScale="0" numberSuffix=" procent"><set label="Nie" value="Resource id #5" /><set label="Tak" value="Resource id #6"/></chart>
What are those "Resource id #5" & 6 strings ??? Query should return just number of counted rows... and it does when used against database in any other sql query tool... greetings Piotrek Truszczynski
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 4/1/2008 5:58:27 AM
Posts: 3,
Visits: 5
|
|
| Sorry, sorry, my fault it's a mysql_query type, need to fetch it form the array. BTW how to delete posts on this forums ??? greetings PiotrekT
|
|
|
|