Thanks for the hint.
I've never used cursors before.
Once I discovered that you declare the cursor before the creation of the temporary table I was able to get it working :)
Very powerful.
On a separate issue I'm displaying the above graphs in a jquery dialogue (modal) using a button.
One issue I can't resolve is that the Powered by mydbr footer is for some reason appearing after 11 of the graphs. There are 13 in total.
select 'dbr.html','<div id="budgraphs">
<div class ="graphs">';
select 'dbr.title','';
select 'dbr.chart', 'donut', '', 450, 350;
select 'dbr.chart.options', 'donut.size', 20;
select 'dbr.chart.options', 'donut.text', v_sitename;
select 'dbr.chart.options', 'donut.font.size', 10;
select 'dbr.chart.options', 'label_font_size', 10;
select 'dbr.chart.color', '0x008000', '0xFFA500', '0xFF0000';
select 'Sold',v_sold
union
select 'Booked',v_book
union
select 'Required',v_req;
select 'dbr.html','</div>';
end loop get_salesbud;
close salesbud_cursor;
select 'dbr.html',' <div class="clear"></div>';
select 'dbr.html','</div>';
The class graphs is just a float:left and I'm calling the report using load() with section #budgraphs.
Any thought as to why it's appearing where it is?
Many thanks
Jake