Tombstone Report post Posted April 1, 2009 Hi all, Probably a stupid question, and may well just be me being dumb, but assuming I have a field (Pages) within my database, is there anyway to chart only the 10 records with the highest number of Pages? I can successfully chart everyone of course, but its mayhem on a piechart with 400 records showing Share this post Link to post Share on other sites
Dhruva Report post Posted April 1, 2009 Hello Tombstone, Welcome to the forum Could you please try to pass an SQL Query which will return the top 10 rows of the table (on the basis of your chosen field) to the FusionCharts class? Share this post Link to post Share on other sites
Tombstone Report post Posted April 1, 2009 Dhruva (4/1/2009)Hello Tombstone, Welcome to the forum Could you please try to pass an SQL Query which will return the top 10 rows of the table (on the basis of your chosen field) to the FusionCharts class? Thanks, I think I am way off the mark on this, been staring at too much PHP today and its all blending into each other Just operating off the dbexample.php at the moment, and tried this.. $strQuery = "select * from (SELECT Pages FROM April ORDER BY Pages+0 DESC) as TotOutput where ROWNUM < 11 and User=" . $ors['User']; But that seems to be totally wrong, which isnt surprising for me Share this post Link to post Share on other sites
Dhruva Report post Posted April 2, 2009 Hello again! Could you modify your query thus, and try again? $strQuery = "select * from (SELECT Pages FROM April ORDER BY Pages+0 DESC LIMIT 10) as TotOutput where User=" . $ors['User']; Hope this helps! Share this post Link to post Share on other sites
Tombstone Report post Posted April 2, 2009 Thanks Luckily I managed to get it sorted this morning, amazing what a night of not staring at the php can do Corrected the error I was making and its now working beautifully ! Share this post Link to post Share on other sites
Dhruva Report post Posted April 2, 2009 Hi! You're welcome! Understandably so. :hehe: Looking constantly at code can make one woozy. We're people, after all, not compilers. Always happy to help, though! Share this post Link to post Share on other sites