การสร้างตารางแสดงข้อมูล
Code
ผลลัพธ์
Code
<?php
require_once('public/generate-table.php');
$table=new Table();
$sql="select s.id,s.name,s.kind,s.area,s.tambon,s.amphoe
from school s where 1 __w__ group by s.id order by s.name2";
$sql_cnt="SELECT count(*) cnt FROM `school` s where 1 __w__";
$field=$db->getFieldFromSql($sql);
$table->addField($field);
$table->addField($f);
$data=$db->getDataFromSql($sql);
$rows=$db->getRowsFromSql($sql_cnt);
$table->data=$data;
$table->rows=$rows;
echo $table->create();