﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>FusionCharts Forum / FusionCharts v3 / Using FusionCharts / FusionCharts and PHP  / [MySQL Chart] Values being shown multiple times / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>FusionCharts Forum</description><link>http://www.fusioncharts.com/forum/</link><webMaster>support@fusioncharts.com</webMaster><lastBuildDate>Wed, 07 Jan 2009 14:39:18 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: [MySQL Chart] Values being shown multiple times</title><link>http://www.fusioncharts.com/forum/Topic3025-31-1.aspx</link><description>[quote][b]Sudipto Choudhury (11/16/2007)[/b][hr]Hi,&lt;br&gt;&lt;br&gt;This will need proper SQL Query where you can use LIMIT &lt;br&gt;&lt;br&gt;"SELECT * FROM tbl LIMIT 5,10" // this will show records fom 6 to 15&lt;br&gt;&lt;br&gt;Ref : &lt;A href="http://dev.mysql.com/doc/refman/5.0/en/select.html"&gt;http://dev.mysql.com/doc/refman/5.0/en/select.html&lt;/A&gt;&lt;br&gt;&lt;br&gt;Now for each press of button you can reload the chart passing the limits to another file where the XML will be created from database.&lt;br&gt;&lt;br&gt;You can go through our PHP example...from Documentaion's 'Guide For Web Developers' section's -Using With PHP - PHP,JAvascript and DataURL page...for more insight on how to use that.&lt;br&gt;&lt;br&gt;&lt;A href="http://www.fusioncharts.com/docs/Contents/PHP_JS_URL.html"&gt;http://www.fusioncharts.com/docs/Contents/PHP_JS_URL.html&lt;/A&gt;[/quote]&lt;br&gt;&lt;br&gt;Thanks a lot&lt;br&gt;&lt;br&gt;I will check it out to see it it works.</description><pubDate>Fri, 16 Nov 2007 08:07:33 GMT</pubDate><dc:creator>AjnabiZ</dc:creator></item><item><title>RE: [MySQL Chart] Values being shown multiple times</title><link>http://www.fusioncharts.com/forum/Topic3025-31-1.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;This will need proper SQL Query where you can use LIMIT  &lt;/P&gt;&lt;P&gt;"SELECT * FROM tbl LIMIT 5,10" // this will show records fom 6 to 15&lt;/P&gt;&lt;P&gt;Ref : &lt;A href="http://dev.mysql.com/doc/refman/5.0/en/select.html"&gt;http://dev.mysql.com/doc/refman/5.0/en/select.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Now for each press of button you can reload the chart passing the limits to another file where the XML will be created from database.&lt;/P&gt;&lt;P&gt;You can go through our PHP example...from Documentaion's 'Guide For Web Developers' section's -Using With PHP - PHP,JAvascript and DataURL page...for more insight on how to use that.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.fusioncharts.com/docs/Contents/PHP_JS_URL.html"&gt;http://www.fusioncharts.com/docs/Contents/PHP_JS_URL.html&lt;/A&gt;</description><pubDate>Fri, 16 Nov 2007 06:25:47 GMT</pubDate><dc:creator>Sudipto Choudhury</dc:creator></item><item><title>RE: [MySQL Chart] Values being shown multiple times</title><link>http://www.fusioncharts.com/forum/Topic3025-31-1.aspx</link><description>Hello&lt;br&gt;&lt;br&gt;Can anyone tell me what settings to make when there are 1000+ customers and I need to show their totals.&lt;br&gt;&lt;br&gt;The graphs will get jumbled with so many names.&lt;br&gt; &lt;br&gt;Is there a way to show , let say, 10 customers , then click next to see the Next 10 and so on.</description><pubDate>Fri, 16 Nov 2007 03:11:17 GMT</pubDate><dc:creator>AjnabiZ</dc:creator></item><item><title>RE: [MySQL Chart] Values being shown multiple times</title><link>http://www.fusioncharts.com/forum/Topic3025-31-1.aspx</link><description>Hello&lt;br&gt;&lt;br&gt;Thanks alot for a quick reply as well as the fix.&lt;br&gt;&lt;br&gt;I added the distinct user_id and name to the sql statement and it worked fine :Wow:&lt;br&gt;&lt;br&gt;</description><pubDate>Tue, 13 Nov 2007 06:47:42 GMT</pubDate><dc:creator>AjnabiZ</dc:creator></item><item><title>RE: [MySQL Chart] Values being shown multiple times</title><link>http://www.fusioncharts.com/forum/Topic3025-31-1.aspx</link><description>&lt;DIV&gt;Hi ,&lt;/DIV&gt;&lt;DIV&gt; Try using this SQL query for the first SQL Query String&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;"select distinct user_id,name from va_orders"&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;YOu can even optimize the SQL to put all in a single SQL Query with out the need to second query result. We did that for demonstration purpose.&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;can use this "select  name, sum(order_total) from va_orders group by name" &lt;BR&gt;&lt;/DIV&gt;&lt;DIV&gt;The code may look like this:&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;[code]$strQuery = "select  name, sum(order_total) from va_orders group by name";&lt;BR&gt;   $result = mysql_query($strQuery) or die(mysql_error());&lt;BR&gt;   &lt;BR&gt;   if ($result) {&lt;BR&gt;      while($ors = mysql_fetch_array($result)) {&lt;BR&gt;         $strXML .= "&amp;lt;set label='" . $ors['name'] . "' value='" . $ors['OrderTotal'] . "' /&amp;gt;";&lt;BR&gt;         &lt;BR&gt;         }&lt;BR&gt;    }[/code]&lt;/DIV&gt;</description><pubDate>Tue, 13 Nov 2007 06:06:36 GMT</pubDate><dc:creator>Sudipto Choudhury</dc:creator></item><item><title>[MySQL Chart] Values being shown multiple times</title><link>http://www.fusioncharts.com/forum/Topic3025-31-1.aspx</link><description>Hello&lt;br&gt;&lt;br&gt;I am trying to implement fusioncharts evaluation version with my shopping cart.&lt;br&gt;&lt;br&gt;Here is the problem :&lt;br&gt;[url=http://i91.photobucket.com/albums/k283/AjnabiZ/chart.jpg][/url]&lt;br&gt;&lt;br&gt;I have attached a screenshot as well.&lt;br&gt;&lt;br&gt;I have trying to show "Total Sales by Customer".&lt;br&gt;&lt;br&gt;I do get the total amount correctly, but it is being displayed multiple times.&lt;br&gt;&lt;br&gt;Here is the PHP Code im using :&lt;br&gt;&lt;br&gt;[code]&lt;br&gt;&lt;?php   &lt;br&gt;    //Connect to the DB&lt;br&gt;   $link = connectToDB();&lt;br&gt;&lt;br&gt;   //$strXML will be used to store the entire XML document generated&lt;br&gt;   //Generate the chart element&lt;br&gt;   $strXML = "&lt;chart caption='Sales Output report' subCaption='By Quantity' pieSliceDepth='10' showBorder='1' formatNumberScale='0' numberSuffix=' USD'&gt;";&lt;br&gt;&lt;br&gt;   //Fetch all factory records&lt;br&gt;   $strQuery = "select * from va_orders";&lt;br&gt;   $result = mysql_query($strQuery) or die(mysql_error());&lt;br&gt;&lt;br&gt;   //Iterate through each factory&lt;br&gt;   if ($result) {&lt;br&gt;      while($ors = mysql_fetch_array($result)) {&lt;br&gt;         //Now create a second query to get details for this factory&lt;br&gt;         $strQuery = "select sum(order_total) as OrderTotal from va_orders where user_id=" . $ors['user_id'];&lt;br&gt;         $result2 = mysql_query($strQuery) or die(mysql_error());&lt;br&gt;         $ors2 = mysql_fetch_array($result2);&lt;br&gt;         //Generate &lt;set label='..' value='..'/&gt;&lt;br&gt;         $strXML .= "&lt;set label='" . $ors['name'] . "' value='" . $ors2['OrderTotal'] . "' /&gt;";&lt;br&gt;         //free the resultset&lt;br&gt;         mysql_free_result($result2);&lt;br&gt;      }&lt;br&gt;   }&lt;br&gt;   mysql_close($link);&lt;br&gt;&lt;br&gt;   //Finally, close &lt;chart&gt; element&lt;br&gt;   $strXML .= "&lt;/chart&gt;";&lt;br&gt;&lt;br&gt;   //Create the chart - Pie 3D Chart with data from $strXML&lt;br&gt;   echo renderChart("../FusionCharts/Column3D.swf", "", $strXML, "FactorySum", 600, 300, false, false);&lt;br&gt;?&gt;&lt;br&gt;[/code]&lt;br&gt;&lt;br&gt;</description><pubDate>Tue, 13 Nov 2007 05:26:21 GMT</pubDate><dc:creator>AjnabiZ</dc:creator></item></channel></rss>