﻿<?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  / Newbie question - trying to graph MSColumn3D.swf from MySQL data / 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, 03 Dec 2008 02:42:25 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Newbie question - trying to graph MSColumn3D.swf from MySQL data</title><link>http://www.fusioncharts.com/forum/Topic3898-31-1.aspx</link><description>OK, well I figured out how to do it dirty. I'm wondering if someone can help me clean this code up a bit?&lt;/P&gt;&lt;P&gt;[code]&lt;/P&gt;&lt;FONT size=1&gt;&lt;FONT size=1&gt;&lt;P&gt;&amp;lt;?php &lt;/P&gt;&lt;P&gt;header("Content-type: text/xml" ); &lt;/P&gt;&lt;P&gt;$host = "localhost"; &lt;/P&gt;&lt;P&gt;$user = "root"; &lt;/P&gt;&lt;P&gt;$pass = "password" ; &lt;/P&gt;&lt;P&gt;$database = "database"; &lt;/P&gt;&lt;P&gt;$linkID = mysql_connect($host, $user , $pass) or die("Could not connect to host."); &lt;/P&gt;&lt;P&gt;mysql_select_db ($database, $linkID) or die("Could not find database." ); &lt;/P&gt;&lt;P&gt;$query = "SELECT accounts.name AS \"Client\", accounts_cstm.remaininglicenses_c AS \"RemainingLicenses\", accounts_cstm.usedlicenses_c AS \"UsedLicenses\", accounts_cstm.studentsenrolled_c AS \"StudentsEnrolled\" &lt;/P&gt;&lt;P&gt;FROM accounts_cstm INNER JOIN accounts ON accounts_cstm.id_c = accounts.id&lt;/P&gt;&lt;P&gt;WHERE (((accounts_cstm.remaininglicenses_c)&amp;gt;\"0\") AND ((accounts.deleted)=0));"; &lt;/P&gt;&lt;P&gt;$resultID = mysql_query($query, $linkID) or die("Data not found."); &lt;/P&gt;&lt;P&gt;$xml_output = "&amp;lt;chart caption=\"License Usage Report\" subcaption=\"by Client\" palette=\"1\"&amp;gt;"; &lt;/P&gt;&lt;P&gt;$xml_output .= "\t&amp;lt;categories&amp;gt;"; &lt;/P&gt;&lt;P&gt;for($x = 0 ; $x &amp;lt; mysql_num_rows($resultID) ; $x++){ &lt;/P&gt;&lt;P&gt;$row = mysql_fetch_assoc($resultID); &lt;/P&gt;&lt;P&gt;$xml_output .= "\t\t&amp;lt;category label=\"" . $row['Client'] . "\" /&amp;gt;"; &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;$xml_output .= "\t&amp;lt;/categories&amp;gt;"; &lt;/P&gt;&lt;P&gt;//GET LICENSES REMAINING&lt;/P&gt;&lt;P&gt;$query = "SELECT accounts.name AS \"Client\", accounts_cstm.remaininglicenses_c AS \"RemainingLicenses\", accounts_cstm.usedlicenses_c AS \"UsedLicenses\", accounts_cstm.studentsenrolled_c AS \"StudentsEnrolled\" &lt;/P&gt;&lt;P&gt;FROM accounts_cstm INNER JOIN accounts ON accounts_cstm.id_c = accounts.id&lt;/P&gt;&lt;P&gt;WHERE (((accounts_cstm.remaininglicenses_c)&amp;gt;\"0\") AND ((accounts.deleted)=0));"; &lt;/P&gt;&lt;P&gt;$resultID2 = mysql_query($query, $linkID) or die("Data not found."); &lt;/P&gt;&lt;P&gt;$xml_output .= "\t&amp;lt;dataset SeriesName=\"Licenses Remaining\"&amp;gt;"; &lt;/P&gt;&lt;P&gt;for($y = 0 ; $y &amp;lt; mysql_num_rows($resultID2) ; $y++){ &lt;/P&gt;&lt;P&gt;$rowy = mysql_fetch_assoc($resultID2); &lt;/P&gt;&lt;P&gt;$xml_output .= "\t\t&amp;lt;set value=\"" . $rowy['RemainingLicenses'] . "\" /&amp;gt;"; &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;$xml_output .= "\t&amp;lt;/dataset&amp;gt;"; &lt;/P&gt;&lt;P&gt;//GET USED LICENSES&lt;/P&gt;&lt;P&gt;$query = "SELECT accounts.name AS \"Client\", accounts_cstm.remaininglicenses_c AS \"RemainingLicenses\", accounts_cstm.usedlicenses_c AS \"UsedLicenses\", accounts_cstm.studentsenrolled_c AS \"StudentsEnrolled\" &lt;/P&gt;&lt;P&gt;FROM accounts_cstm INNER JOIN accounts ON accounts_cstm.id_c = accounts.id&lt;/P&gt;&lt;P&gt;WHERE (((accounts_cstm.remaininglicenses_c)&amp;gt;\"0\") AND ((accounts.deleted)=0));"; &lt;/P&gt;&lt;P&gt;$resultID2 = mysql_query($query, $linkID) or die("Data not found."); &lt;/P&gt;&lt;P&gt;$xml_output .= "\t&amp;lt;dataset SeriesName=\"Used Licenses\"&amp;gt;"; &lt;/P&gt;&lt;P&gt;for($y = 0 ; $y &amp;lt; mysql_num_rows($resultID2) ; $y++){ &lt;/P&gt;&lt;P&gt;$rowy = mysql_fetch_assoc($resultID2); &lt;/P&gt;&lt;P&gt;$xml_output .= "\t\t&amp;lt;set value=\"" . $rowy['UsedLicenses'] . "\" /&amp;gt;"; &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;$xml_output .= "\t&amp;lt;/dataset&amp;gt;"; &lt;/P&gt;&lt;P&gt;//GET STUDENTS ENROLLED&lt;/P&gt;&lt;P&gt;$query = "SELECT accounts.name AS \"Client\", accounts_cstm.remaininglicenses_c AS \"RemainingLicenses\", accounts_cstm.usedlicenses_c AS \"UsedLicenses\", accounts_cstm.studentsenrolled_c AS \"StudentsEnrolled\" &lt;/P&gt;&lt;P&gt;FROM accounts_cstm INNER JOIN accounts ON accounts_cstm.id_c = accounts.id&lt;/P&gt;&lt;P&gt;WHERE (((accounts_cstm.remaininglicenses_c)&amp;gt;\"0\") AND ((accounts.deleted)=0));"; &lt;/P&gt;&lt;P&gt;$resultID2 = mysql_query($query, $linkID) or die("Data not found."); &lt;/P&gt;&lt;P&gt;$xml_output .= "\t&amp;lt;dataset SeriesName=\"Students Enrolled\"&amp;gt;"; &lt;/P&gt;&lt;P&gt;for($y = 0 ; $y &amp;lt; mysql_num_rows($resultID2) ; $y++){ &lt;/P&gt;&lt;P&gt;$rowy = mysql_fetch_assoc($resultID2); &lt;/P&gt;&lt;P&gt;$xml_output .= "\t\t&amp;lt;set value=\"" . $rowy['StudentsEnrolled'] . "\" /&amp;gt;"; &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;$xml_output .= "\t&amp;lt;/dataset&amp;gt;"; &lt;/P&gt;&lt;P&gt;$xml_output .= "\t&amp;lt;/chart&amp;gt;";&lt;/P&gt;&lt;P&gt;echo $xml_output; &lt;/P&gt;&lt;P&gt;?&amp;gt; &lt;/P&gt;&lt;P&gt;[/code]&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;</description><pubDate>Thu, 17 Jan 2008 14:25:58 GMT</pubDate><dc:creator>PlainDonut</dc:creator></item><item><title>Newbie question - trying to graph MSColumn3D.swf from MySQL data</title><link>http://www.fusioncharts.com/forum/Topic3898-31-1.aspx</link><description>Boy have I stayed up late trying to figure this one out. I hope someone can help me because I was getting meaner by the hour for anyone who approached me. Here's what I'm trying to do... &lt;P&gt;I have a database query of clients, remaining licenses, used licenses and enrolled. When I try to format the XML data I can't seem to group them correctly. I believe it is because of my lack of knowledge on php mysql arrays. I'm a quick learner though. Here is what the correct XML output should look like:&lt;/P&gt;&lt;P&gt;[code]&lt;/P&gt;&lt;FONT size=1&gt;&lt;DIV class=e&gt;&lt;DIV class=c style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color=#990000&gt;&lt;SPAN class=t&gt;chart&lt;/SPAN&gt;&lt;SPAN class=t&gt; caption&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;="&lt;/FONT&gt;&lt;/SPAN&gt;&lt;B&gt;License Usage Report&lt;/B&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;"&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt; subcaption&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;="&lt;/FONT&gt;&lt;/SPAN&gt;&lt;B&gt;by Client&lt;/B&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;"&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt; palette&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;="&lt;/FONT&gt;&lt;/SPAN&gt;&lt;B&gt;1&lt;/B&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN class=m&gt;"&lt;/SPAN&gt;&lt;SPAN class=m&gt;&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class=e&gt;&lt;DIV class=c style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;categories&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class=e&gt;&lt;DIV style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;category&lt;/FONT&gt;&lt;/SPAN&gt; &lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;label&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;="&lt;/FONT&gt;&lt;/SPAN&gt;&lt;B&gt;Clients1&lt;/B&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN class=m&gt;"&lt;/SPAN&gt;&lt;SPAN class=m&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=e&gt;&lt;DIV style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;category&lt;/FONT&gt;&lt;/SPAN&gt; &lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;label&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;="&lt;/FONT&gt;&lt;/SPAN&gt;&lt;B&gt;Client2&lt;/B&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN class=m&gt;"&lt;/SPAN&gt;&lt;SPAN class=m&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=e&gt;&lt;DIV style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;category&lt;/FONT&gt;&lt;/SPAN&gt; &lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;label&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;="&lt;/FONT&gt;&lt;/SPAN&gt;&lt;B&gt;Client3&lt;/B&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN class=m&gt;"&lt;/SPAN&gt;&lt;SPAN class=m&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;categories&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=e&gt;&lt;DIV class=c style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color=#990000&gt;&lt;SPAN class=t&gt;dataset&lt;/SPAN&gt;&lt;SPAN class=t&gt; SeriesName&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;="&lt;/FONT&gt;&lt;/SPAN&gt;&lt;B&gt;Licenses Remaining&lt;/B&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN class=m&gt;"&lt;/SPAN&gt;&lt;SPAN class=m&gt;&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class=e&gt;&lt;DIV style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;set&lt;/FONT&gt;&lt;/SPAN&gt; &lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;value&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN class=m&gt;="&lt;/SPAN&gt;&lt;B&gt;&lt;/B&gt;&lt;SPAN class=m&gt;"&lt;/SPAN&gt;&lt;SPAN class=m&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=e&gt;&lt;DIV style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;set&lt;/FONT&gt;&lt;/SPAN&gt; &lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;value&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;="&lt;/FONT&gt;&lt;/SPAN&gt;&lt;B&gt;129&lt;/B&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN class=m&gt;"&lt;/SPAN&gt;&lt;SPAN class=m&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=e&gt;&lt;DIV style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;set&lt;/FONT&gt;&lt;/SPAN&gt; &lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;value&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;="&lt;/FONT&gt;&lt;/SPAN&gt;&lt;B&gt;72&lt;/B&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN class=m&gt;"&lt;/SPAN&gt;&lt;SPAN class=m&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;dataset&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=e&gt;&lt;DIV class=c style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color=#990000&gt;&lt;SPAN class=t&gt;dataset&lt;/SPAN&gt;&lt;SPAN class=t&gt; SeriesName&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;="&lt;/FONT&gt;&lt;/SPAN&gt;&lt;B&gt;Used Licenses&lt;/B&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN class=m&gt;"&lt;/SPAN&gt;&lt;SPAN class=m&gt;&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class=e&gt;&lt;DIV style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;set&lt;/FONT&gt;&lt;/SPAN&gt; &lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;value&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN class=m&gt;="&lt;/SPAN&gt;&lt;B&gt;&lt;/B&gt;&lt;SPAN class=m&gt;"&lt;/SPAN&gt;&lt;SPAN class=m&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=e&gt;&lt;DIV style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;set&lt;/FONT&gt;&lt;/SPAN&gt; &lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;value&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;="&lt;/FONT&gt;&lt;/SPAN&gt;&lt;B&gt;283&lt;/B&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN class=m&gt;"&lt;/SPAN&gt;&lt;SPAN class=m&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=e&gt;&lt;DIV style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;set&lt;/FONT&gt;&lt;/SPAN&gt; &lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;value&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;="&lt;/FONT&gt;&lt;/SPAN&gt;&lt;B&gt;0&lt;/B&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN class=m&gt;"&lt;/SPAN&gt;&lt;SPAN class=m&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;dataset&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=e&gt;&lt;DIV class=c style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color=#990000&gt;&lt;SPAN class=t&gt;dataset&lt;/SPAN&gt;&lt;SPAN class=t&gt; SeriesName&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;="&lt;/FONT&gt;&lt;/SPAN&gt;&lt;B&gt;Students Enrolled&lt;/B&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN class=m&gt;"&lt;/SPAN&gt;&lt;SPAN class=m&gt;&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class=e&gt;&lt;DIV style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;set&lt;/FONT&gt;&lt;/SPAN&gt; &lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;value&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN class=m&gt;="&lt;/SPAN&gt;&lt;B&gt;&lt;/B&gt;&lt;SPAN class=m&gt;"&lt;/SPAN&gt;&lt;SPAN class=m&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=e&gt;&lt;DIV style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;set&lt;/FONT&gt;&lt;/SPAN&gt; &lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;value&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;="&lt;/FONT&gt;&lt;/SPAN&gt;&lt;B&gt;120&lt;/B&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN class=m&gt;"&lt;/SPAN&gt;&lt;SPAN class=m&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=e&gt;&lt;DIV style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;set&lt;/FONT&gt;&lt;/SPAN&gt; &lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;value&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;="&lt;/FONT&gt;&lt;/SPAN&gt;&lt;B&gt;0&lt;/B&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN class=m&gt;"&lt;/SPAN&gt;&lt;SPAN class=m&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;dataset&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;chart&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;[/code]&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&lt;/FONT&gt;&lt;/SPAN&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;but instead my code cycles through all the rows instead of columns so I get this (slightly abbreviated to avoid redundancy) - &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&lt;/FONT&gt;&lt;/SPAN&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;[code]&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&lt;/FONT&gt;&lt;/SPAN&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=m&gt;&lt;DIV class=e&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;FONT color=#0000ff&gt;&lt;SPAN class=m&gt;&amp;lt;?&lt;/SPAN&gt;&lt;SPAN class=pi&gt;xml version="1.0" &lt;/SPAN&gt;&lt;SPAN class=m&gt;?&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt; &lt;/DIV&gt;&lt;DIV class=e&gt;&lt;DIV class=c style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;entries&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class=e&gt;&lt;DIV class=c style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;categories&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class=e&gt;&lt;DIV style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;client&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=tx&gt;&lt;STRONG&gt;Client1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;client&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;categories&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=e&gt;&lt;DIV class=c style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;categories&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class=e&gt;&lt;DIV style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;client&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=tx&gt;&lt;STRONG&gt;Client2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;client&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;categories&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=e&gt;&lt;DIV class=c style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;categories&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class=e&gt;&lt;DIV style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;client&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=tx&gt;&lt;STRONG&gt;Client3&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;client&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=b&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#ff0000&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;categories&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=e&gt;&lt;DIV class=c style="MARGIN-LEFT: 1em; TEXT-INDENT: -2em"&gt; &lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;lt;/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=t&gt;&lt;FONT color=#990000&gt;entries&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&lt;/FONT&gt;&lt;/SPAN&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;[/code]&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&lt;/FONT&gt;&lt;/SPAN&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;This is the php code that I'm using to generate XML output - &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;&lt;/FONT&gt;&lt;/SPAN&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=m&gt;&lt;FONT color=#0000ff&gt;[code]&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=m&gt;&lt;FONT size=1&gt;&lt;P&gt;&amp;lt;?php &lt;/P&gt;&lt;P&gt;header("Content-type: text/xml" ); &lt;/P&gt;&lt;P&gt;$host = "localhost"; &lt;/P&gt;&lt;P&gt;$user = "root"; &lt;/P&gt;&lt;P&gt;$pass = "password" ; &lt;/P&gt;&lt;P&gt;$database = "database"; &lt;/P&gt;&lt;P&gt;$linkID = mysql_connect($host, $user , $pass) or die("Could not connect to host."); &lt;/P&gt;&lt;P&gt;mysql_select_db ($database, $linkID) or die("Could not find database." ); &lt;/P&gt;&lt;P&gt;$query = "SELECT accounts.name AS \"Client\", accounts_cstm.remaininglicenses_c AS \"RemainingLicenses\", accounts_cstm.usedlicenses_c AS \"UsedLicenses\", accounts_cstm.studentsenrolled_c AS \"StudentsEnrolled\" &lt;/P&gt;&lt;P&gt;FROM accounts_cstm INNER JOIN accounts ON accounts_cstm.id_c = accounts.id&lt;/P&gt;&lt;P&gt;WHERE (((accounts_cstm.remaininglicenses_c)&amp;gt;\"0\") AND ((accounts.deleted)=0));"; &lt;/P&gt;&lt;P&gt;$resultID = mysql_query($query, $linkID) or die("Data not found."); &lt;/P&gt;&lt;P&gt; $xml_output = "&amp;lt;?xml version=\"1.0\"?&amp;gt;"; &lt;/P&gt;&lt;P&gt;$xml_output .= "&amp;lt;entries&amp;gt;"; &lt;/P&gt;&lt;P&gt;for($x = 0 ; $x &amp;lt; mysql_num_rows($resultID) ; $x++){ &lt;/P&gt;&lt;P&gt;$row = mysql_fetch_assoc($resultID); &lt;/P&gt;&lt;P&gt;$xml_output .= "\t&amp;lt;categories&amp;gt;"; &lt;/P&gt;&lt;P&gt;$xml_output .= "\t\t&amp;lt;client&amp;gt;" . $row['Client'] . "&amp;lt;/client&amp;gt;"; &lt;/P&gt;&lt;P&gt;$xml_output .= "\t&amp;lt;/categories&amp;gt;"; &lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=1&gt;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;P&gt;$xml_output .= "&amp;lt;/entries&amp;gt;"; &lt;/P&gt;&lt;P&gt;echo $xml_output; &lt;/P&gt;&lt;P&gt;?&amp;gt; &lt;/P&gt;&lt;P&gt;[/code]&lt;/P&gt;&lt;P&gt;I feel like I'm so close to figuring this out. I believe I just need help on the array portion and I can make the rest work. I did try to use the documentation but I'm thrown for a loop when it uses two databases, a SUM function with a sub query and a totally different chart (pie chart as opposed to this 3D column chart I'm trying to work with here.&lt;/P&gt;&lt;P&gt;In general, I'm trying to query two tables and spit out 4 pieces of data into a 3D column chart.&lt;/P&gt;&lt;P&gt;Thanks in advance for any help!&lt;/P&gt;&lt;P&gt;PD&lt;/P&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/FONT&gt;</description><pubDate>Thu, 17 Jan 2008 01:23:40 GMT</pubDate><dc:creator>PlainDonut</dc:creator></item></channel></rss>