Intro :Sure, Lion and iCloud are big news, but, for the millions of iPhone users out there, the real news at the center of the Apple's WWDC conference was iOS 5, equipped with cutting-edge (though, in some cases, strangely familiar) notifications, messaging, and cable-free connectivity. These goodies—and hundreds of other (unspecified) features—now available in developer release, won't appear until the fall, perhaps at the same time as a new iPhone. It seems like just about all the competition–Android, Windows Phone 7, and BlackBerry—will be releasing new versions between now and then, too.
Using Apple's release as the baseline, I've pulled out 13 of the most exciting new features of iOS 5. The iPhone—and iOS 5—will face three popular challengers this fall. Each of these contenders will be a bit sprier by the iOS 5 debut: Microsoft will deliver Windows Phone 7 Mango in Q4; Blackberry OS 7 also ought to be available; and Android 2.3 Gingerbread will be ubiquitous, with Android 3.1 Ice Cream served up for the holidays. How will iOS stack up?
1.Tentukan limit/batas, kemudian cek pada halaman dan posisi berapa pada saat skrip dijalankan
2.Sesuaikan perintah SQL dengan limit/batas dan posisi
3.Hitung total data halaman serta tampilkan link untuk navigasi halaman.
Skrip paging.php
<table>
<tr bgcolor="#999999"><th bgcolor="#CCCCCC">No</th><th>Nama</th><th>Alamat</th></tr>
<?php
mysql_connect("localhost","root","pajarmaning");
mysql_select_db("dbphp");
//Langkah 1: Tentukan batas,cek halaman & posisi data
$batas = 5;
$halaman = $_GET['halaman'];
if(empty($halaman)){
$posisi=0;
$halaman=1;
}
else{
$posisi = ($halaman-1) * $batas;
}
//Langkah 2: Sesuaikan perintah SQL
$tampil="select * from anggota limit $posisi,$batas";
$hasil=mysql_query($tampil);
$no=$posisi+1; // Agar angka (penomoran) mengikuti paging
while ($data=mysql_fetch_array($hasil)){
echo "<tr bgcolor=CCCCCC><td>$no</td><td>$data[nama]</td><td>$data[alamat]</td></tr>";
$no++;
}
echo "</table>";
//Langkah 3: Hitung total data dan halaman serta link 1,2,3 ...
echo "<br>Halaman : ";
$file="paging_1.php";
$tampil2="select * from anggota";
$hasil2=mysql_query($tampil2);
$jmldata=mysql_num_rows($hasil2);
$jmlhalaman=ceil($jmldata/$batas);
for($i=1;$i<=$jmlhalaman;$i++)
if ($i != $halaman)
{
echo " <a href=$_SERVER[PHP_SELF]?halaman=$i>$i</A> | ";
}
else
{
echo " <b>$i</b> | ";
}
echo "<p>Total anggota : <b>$jmldata</b> orang</p>";
?>
Sekarang jalankan, hasilnya :