help newbie

From: Date: Mon, 08 Dec 2003 14:23:51 +0000
Subject: help newbie
Groups: php.db 
Request: Send a blank email to php-db+get-31934@lists.php.net to get a copy of this message
Hi , please help this newbie , how to make my database view from [1] [2] [3] [4] [5] [6] [7] [8] to <<< 1 2 3 4 >>> Thanks very much Hadi require("cobaconfig.php"); > > $numresult = mysql_query("select * from dataiklanbaris order by id desc"); > $jumlah = mysql_num_rows($numresult); > $limit = 20; > > > if (empty($offset)) { > $offset = 0; > } > $query = "select * from dataiklanbaris order by id desc limit $offset, > $limit"; > //pembagian halaman dimulai > $result = mysql_query($query); > > $halaman = intval($jumlah/$limit); > if ($jumlah%$limit) { > $halaman++; > } > for ($i = 1; $i<=$halaman; $i++) { > > $newoffset=$limit*($i-1); > if ($offset != $newoffset) { > echo " [<a href=\"lihatiklan.php?offset=$newoffset\">$i</a>]"; > } else { > echo "[$i]"; > } > } > //pembagian halaman selesai > > while ($row = mysql_fetch_array($result)) { > echo (" > > <tr> > <td width=\"330px\"><font size > =\"3\">$row[isiiklan]<br></td> > <td width=\"50px\"><p align =\"center\"><font size > =\"2\">$row[lt]<br></td> > <td width=\"50px\"><p align =\"center\"><font size > =\"2\">$row[lb]<br></td> > <td width=\"70px\"><p align =\"center\"><font size > =\"2\">$row[harga]<br></td> > <td width=\"100px\"><p align =\"center\"><font size > =\"2\">$row[kecamatan]<br></td> <td width=\"100px\"><p align =\"center\"><font size =\"2\">$row[kota]<br></td> <td width=\"100px\"><a href=\"detail.php?id=$row[id]\" target=\"blank\"><p align =\"center\"><font size =\"2\">$row[gambar]<br></a></td> </tr> "); } ?>

« previous php.db (#31934) next »