Sample 4

Data 1 - 12 of 349 [Total 30 Pages]
1 163 CARA U/ MENGURANGI LEMAK2 301 STYLISH STORAGE IDEAS/10-013 53,5 PENEMUAN/0402
4 8 CRAYON CRAYOLA5 AFGHANISTAN DI TENGAH ARUS.../4-26 AHMADIYAH&PEMBAJAKAN ALQURAN 04.02
7 AJARAN DAN JALAN KEMATIAN SYEKHSITI8 AKUNTANSI INTERMEDIATE JL.1/THOMAS9 AL-FUTUHATUL ILAHIYAH/MK
10 AL-QUR'AN STANDAR H/P JL.KALF HVS/D11 ANALISIS INVESTASI..PORTOFOLIO ED.112 APA DAN BAGAIMANA E-COMMERCE

[1] [2] [3] [4] [5] [6] [next]

sample4.php:
<?
require("paging_class.php");

// create table //
$td=3;
$tr=4;

$paging=new paging(($td*$tr),5);
$paging->db("localhost","username","password","dbname");
$paging->query("select * from paging order by MY_FIELD asc");

$page=$paging->print_info();
    echo 
"Data $page[start] - $page[end] of $page[total] [Total $page[total_pages] Pages]<hr>\n";

$table_tr=ceil(($page[total]-$page[start]+1)/$td);
if (
$table_tr>$td$table_tr=$tr;
$table_td=($page[total]-$page[start])+1;
if (
$table_td>$td$table_td=$td;

echo 
"<table border=\"1\">";
for (
$i=1;$i<=$table_tr;$i++) {
    echo 
"<tr>";
        for (
$j=1;$j<=$table_td;$j++) {
            
$result=$paging->result_assoc();
            
$color=$paging->print_color("yellow","#FFCCCC");
            
$number=$paging->print_no();
                if (
$number>$page[total]) {$number="&nbsp;";}
            echo 
"<td bgcolor=\"$color\">$number $result[MY_FIELD]</td>";
        }
    echo 
"</tr>\n";
}
echo 
"</table>";

echo 
"<hr>".$paging->print_link();
?>