This is for create table, before this you must create database with name is "dbname".
CREATE TABLE guestbook (
id int(11) auto_increment,
nama varchar(20),
email varchar(20),
tanggal date,
komentar text,
PRIMARY KEY (id)
)
So, this is code.
";
echo "NamaEmailTanggalKomentar";
while($data = mysql_fetch_array($result))
{
echo "".$data['nama']."".$data['email']."".$data['tanggal']."".$data['komentar']."";
}
echo "";
// mencari jumlah semua data dalam tabel guestbook
$query = "SELECT COUNT(*) AS jumData FROM guestbook";
$hasil = mysql_query($query);
$data = mysql_fetch_array($hasil);
$jumData = $data['jumData'];
// menentukan jumlah halaman yang muncul berdasarkan jumlah semua data
$jumPage = ceil($jumData/$dataPerPage);
// menampilkan link previous
if ($noPage > 1) echo "<< Prev";
// memunculkan nomor halaman dan linknya
for($page = 1; $page <= $jumPage; $page++)
{
if ((($page >= $noPage - 3) && ($page <= $noPage + 3)) || ($page == 1) || ($page == $jumPage))
{
if (($showPage == 1) && ($page != 2)) echo "...";
if (($showPage != ($jumPage - 1)) && ($page == $jumPage)) echo "...";
if ($page == $noPage) echo " ".$page." ";
else echo " ".$page." ";
$showPage = $page;
}
}
// menampilkan link next
if ($noPage < $jumPage) echo "Next >>";
?>
I finded this code in Blog Rosihanari.
You can complete seen theory in there website.