FusionCharts Forum: Wrong query and display the wrong database - FusionCharts Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Wrong query and display the wrong database

#1 User is offline   faye 

  • Forum Newbie
  • Group: Members
  • Posts: 4
  • Joined: 02-August 10

Posted 03 August 2010 - 02:32 AM

Hi all ,



i want query a single table to show the % for Axis y and fileter name as Axis X. I try to run this php, it display a wrong sql query.





Quote


sFILTER nPERCENTAGE



a 30



b 10



c 20



d 40







Quote




$link = connectToDB();







$strXML = "";



$strQuery = "select nPERCENTAGE from tblstats";

$result = mysql_query($strQuery) or die(mysql_error());



if ($result) {

while($ors = mysql_fetch_array($result)) {

$pri_ = $ors['sFILTER'];

$os = $ors['nPERCENTAGE'];



$strXML .= "";



mysql_free_result($result);

}

}

mysql_close($link);







$strXML .= "
";





echo renderChart("../FusionCharts/Charts/FCF_Column3D.swf", "", $strXML, "FactorySum", 600, 300);

?>








Please help me to find out my sql query problems.

Thanks

faye
0

Other Replies To This Topic

#2 User is offline   Rajroop 

  • FusionCharts Team
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1803
  • Joined: 19-May 09

Posted 03 August 2010 - 04:21 AM

Hey,



Welcome to the FusionCharts Forum! ;)



Quote

$strQuery = "select nPERCENTAGE from tblstats";




Here, you have used only 'nPERCENTAGE'.



Quote

$pri_ = $ors['sFILTER'];

$os = $ors['nPERCENTAGE'];




However, in your code you are using 'sFILTER' and 'NPERCENTAGE' both. Thereby causing the error you are facing.



You can modify your query like :

$strQuery = "select sFILTER,nPERCENTAGE from tblstats";



I hope this helps. Looking forward to your updates on this issue.
Regards,

Rajroop Bhaduri

FusionCharts Team

Help us improve our documentation with your precious feedback at:
http://documentation...sioncharts.com/

Follow us @Twitter
0

Other Replies To This Topic

#3 User is offline   faye 

  • Forum Newbie
  • Group: Members
  • Posts: 4
  • Joined: 02-August 10

Posted 03 August 2010 - 11:26 PM

Hi,



Thanks for reply.. Finally i query the correct mysql d..

Thanks for help too..





Regards

fy
0

Other Replies To This Topic

#4 User is offline   Basundhara Ghosal 

  • Supreme Being
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2459
  • Joined: 15-September 09

Posted 04 August 2010 - 01:33 AM

Hi,

We are glad that your issue is resolved.

Keep smiling and keep FusionCharting. ;)

Regards,

Basundhara Ghosal

Follow us on Twitter :D
0

Other Replies To This Topic

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic