Location: PHPKode > projects > THINi Reports > THINiReports-0.1.1/Basic_Grouping_2.php
<?php
 require_once 'lib/THINiReport.class.php';
 
 $dbhandle = new SQLiteDatabase('lib/assets/db/world.db');
 $data = $dbhandle->arrayQuery("SELECT Continent, Region, Code, Name AS Country, SurfaceArea FROM Country", SQLITE_ASSOC);
 
 require_once 'lib/THINiReport.class.php';
 $my_report = new THINiReport();
 $my_report->Load_Data($data);
 $my_report->ShowSub = array('SurfaceArea'=>array(1));
 $my_report->Group_Data(array('Continent', 'Region'));
 $my_report->Column_Widths = array('Code' => 40, 'Country' => 300, 'SurfaceArea' => 90);
 
 echo "<div class='report'>\n";
 echo $my_report->Column_Headers();
 echo $my_report->Display_Group_Divs($my_report->Data_Grouped);
 echo "</div>\n";
?>
Return current item: THINi Reports