![]() |
Anda belum login.
Banyak teman yang menghubungi saya melalui personal message, bagaimana cara membuat sistem paging. Paging ini biasanya digunakan untuk membuat tampilan halaman artikel, buku tamu sehingga dalam sebuah file php dapat menampung beberapa halaman data artikel yang hanya dengan dipisahkan menggunakan nomor halaman-halaman saja.
<?
$host="localhost";
$userdb="root";
$passdb="";
$namadb="halaman";
$sambung=mysql_connect($host,$userdb,$passdb);
mysql_select_db($namadb,$sambung);
?>
<html> <head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>halaman data</title>
</head>
<body>
<table border="1" width="100%" cellspacing="0" cellpadding="0" id="table1">
<tr>
<th width="61">
<p align="center">No.</th>
<th width="211">Nama</th>
<th width="367">alamat</th>
</tr>
<?
$perhalaman=3;
$baca=mysql_query("select * from data");
$jmlhalaman=ceil(mysql_num_rows($baca) / $perhalaman);
if(!isset($page)){
$page=0;
}
$offset= $page * $perhalaman;
$baca2=mysql_query("select * from data order by id limit $offset,$perhalaman");
while($data=mysql_fetch_array($baca2)){
echo"<tr>
<td width=\"61\">
<p align=\"center\">$data[id]</td>
<td width=\"211\">$data[nama]</td>
<td width=\"367\">$data[alamat]</td>
</tr>";
}
?>
</table>
<p>Halaman :
<?
for($i=0;$i<$jmlhalaman;$i++){
$h=$i+1;
echo"<a href=\"halaman_database.php?page=$i\">$h</a> ";
}
?>
</p>
</body>
</html>Sebelum menjalankan script di atas anda harus memiliki tabel dengan nama "halaman".
atribut tael yang harus anda buat adalah no, nama dan alamat.
Selamat mencoba...
apabila ada masalah, silakan post/ replay disini...
![]()
Offline
Mau membuat jaringan yang seperti apa dan untuk apa?
Kalau dasar2 jaringan, bisa lihat2 seputar TCP/IP. Konsepnya berlaku global, untuk semua sistem operasi. Yang berbeda mungkin pada aspek pengaturannya, bagaimana melakukan pengaturan jaringan menggunakan Linux, dsb.
cmiiw..
Offline
What changes have you made to your httpd.conf to attempt to enable PHP with the .php extension?
more information
Offline
In the beginning, phpBB didnt work at all on php5 unless you could enable long arrays in php.ini. And phpBB announced that they wouldnt officially support php5 in their distrobution. And so phpbb-php5 was born.
Currently, nearly all phpBB functions work on php5 out of the box.
urls
Offline
Why is it that phpBB doesnt suppport PHP5 itself? Is this mod just a filler before PHP5 is supported by phpBB???
The reason ask is cuz I use PNphpBB and they will only support what pbpBB is doing and I was hopoing to be able to upgrade to PHP5 soon...
url
Offline