You are on page 1of 1

klo saya sih gini

<?php
mysql_connect("localhost","","");
mysql_select_db("db1777944-kedubes");
$batas=4;
$halaman=$_GET[page];
if (empty($halaman))
{
$halaman=1;
$posisi=0;
}
else
$posisi=($halaman-1)*$batas;
echo "<table cellpadding=5 cellspacing=5 bgcolor=#8888FF>";
echo "<tr bgcolor=#DDDD12><td><b>Nama</b></td><td><b>Alamat</b></td><td><b>Kota<
/b></td><td><b>Lulusan</b></td></tr>";
$tampil="select * from pelamar_kerja LIMIT $posisi,$batas";
$hasil=mysql_query($tampil);
while ($data=mysql_fetch_array($hasil)){
echo "<tr bgcolor=#DDDD12><td>$data[nama]</td><td>$data[alamat]</td><td>$data[ko
ta]</td><td>$data[lulus]</td><td><a href='profile.php?id=$data[no_id]' target='_
blank'>lihat detail</a></td></tr>";
}
$tampil="select * from pelamar_kerja";
$hasil=mysql_query($tampil);
$jmldata=mysql_num_rows($hasil);
$jmlhalaman=ceil($jmldata/$batas);
echo "</table><br>";
for ($i=1; $i<=$jmlhalaman; $i++)
{
if ($i==$halaman)
echo " $i |";
else
echo "<a href='$_SERVER[PHP_SELF]?page=$i'>$i</a> |";
}
?>