strange query return
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



strange query return Expand / Collapse
Author
Message
Posted 4/1/2008 3:59:10 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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

Post #5401
Posted 4/1/2008 5:21:18 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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

Post #5402
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -7:00, Time now is 8:10am


Execution: 0.141.