Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## count.php
- <?php
- include('db_connect.inc.php');
- include('framework.inc.php');
- include('charts.php');
- $qry=mysql_query("SELECT string FROM count");
- $arr=array();
- $chart['chart_type']="pie";
- while($row=mysql_fetch_assoc($qry)) {
- $string = $row['string'];
- $string=trim($string);
- $string=explode(",",$string);
- foreach ($string as $key) {
- if (array_key_exists($key, $arr)) { $arr[$key]++; }
- else { $arr[$key] = 1; }
- }
- }
- $chart['chart_data'][0][0]="String";
- $chart['chart_data'][0][1]="Int";
- $x=1;
- foreach ($arr as $key => $int) {
- $chart['chart_data'][1][$x]=$key;
- $chart['chart_data'][2][$x]=$int;
- $x++;
- }
- dump($chart['chart_data']);
- SendChartData ($chart);
- ## chartoutput.php
- <?php
- include('db_connect.inc.php');
- include('framework.inc.php');
- include('charts.php');
- $random=rand(0,522332);
- echo InsertChart ( "charts.swf", "charts_library", "count.php?nocache=$random", 400, 250 );
Add Comment
Please, Sign In to add comment