help newbie

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>
");
  }

  ?>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux