Location: PHPKode > projects > THINi Reports > THINiReports-0.1.1/Basic_Grouping_1.php
<?php
 require_once 'lib/THINiReport.class.php';
 
 $dbhandle = new SQLiteDatabase('lib/assets/db/postcode.db');
 $data = $dbhandle->arrayQuery("SELECT county AS County, town AS Town, postcode AS Postcode, latitude AS Latitude, longitude AS Longitude FROM postcode WHERE county IS NOT NULL ORDER BY county, postcode LIMIT 1000", SQLITE_ASSOC);
 
 $my_report = new THINiReport();
 $my_report->Load_Data($data);
 
 $my_report->Group_Data(array('County', 'Town'));
 $my_report->Column_Widths = array('Postcode' => 90, 'Latitude' => 90, 'Longitude' => 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