masi error mas
<?php
include"dbconnect.php";
// jumlah data yang akan ditampilkan per halaman
$dataPerPage = 5;
// apabila $_GET['page'] sudah didefinisikan, gunakan nomor halaman tersebut,
// sedangkan apabila belum, nomor halamannya 1.
if(isset($_GET['page']))
{
$noPage = $_GET['page'];
}
else $noPage = 1;
// perhitungan offset
$offset = ($noPage - 1) * $dataPerPage;
// query SQL untuk menampilkan data perhalaman sesuai offset?>
<?php
include "dbconnect.php";
$query = "SELECT * FROM artikel,user WHERE user.idUser = artikel.idUser AND artikel.status = 1 ORDER BY
idArtikel DESC LIMIT $offset, $dataPerPage";
$hasil = mysql_query($query);
while ($data3 = mysql_fetch_array($hasil))
{ ?><div class="postbox3">
<div class="post_title">
<h2 class="item-page-title"><a href="<?php echo"index.php?act=lihatartikel&idArtikel=".$data3['idArtikel'].""; ?>" rel="bookmark"><?php echo"".$data3['judul']."" ?></a></h2>
<div align="right" class="post_author">DiPoskan Pada : <?php echo"".$data3['date'].""; ?> | By <a href="index.php?profile=<?php echo"".$data3['idUser'].""; ?>" title="Posts by <?php echo"".$data3['fullname']."" ?>" rel="author"><?php echo"".$data3['fullname']."" ?></a><hr><br><br></div>
</div>
<blink><div class="post_date">
<div class="post_date_d"></div>
<div class="post_date_m"></div>
</div></blink>
<div class="clear"></div>
<div class="entry">
<table width="738" height="124" border="1">
<tr>
<td width="97">
<?php
function get_first_image($text){
preg_match_all('/<img[^>]*>/i', $text, $matches);
$first_img = isset($matches[0][0]) ? $matches[0][0] : '';
$first_img = preg_replace('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i','$1', $first_img);
return $first_img;
}
$isi_artikel = "".$data3['isi']."";
for($i= 0;$i<10;$i++){
?>
<img src="<? echo get_first_image($isi_artikel);?>"/><?php }?></td>
<td width="687"><?php
$excrept = strip_tags($data3['isi']);
$excrept = substr($excrept,0,625);
$excrept = substr($excrept,0,strrpos($excrept," "));
echo "$excrept ..."; ?></td>
</tr>
</table>
<p><br>
<a href="index.php?act=lihatartikel&idArtikel=<?php echo"".$data3['idArtikel']."" ?>" > <img src="https://encrypted-tbn1.google.com/images?q=tbn:ANd9GcTltlyTjsN1EK9TUVpcWp5DorVPV0pYerz2P45AP5V6UpzxVdWU" width="79" height="18" /></a><br>
</p>
<div class="clear"></div>
</div>
<div class="info">
<span class="info_category">Category: <a href="index.php?kategori=<?php echo"".$data3['kategori'].""; ?>" title="View all posts in <?php echo"".$data3['kategori'].""; ?>" rel="category tag"><?php echo"".$data3['kategori'].""; ?></a>
<br><br><hr></span></div>
</div>
<?php
}
?>
<?php
$query = "SELECT COUNT(*) AS jumData FROM artikel";
$hasil = mysql_query($query);
$data = mysql_fetch_array($hasil);
$jumData = $data['jumData'];
// menentukan jumlah halaman yang muncul berdasarkan jumlah semua data
$jumPage = ceil($jumData/$dataPerPage);
// menampilkan link previous
if ($noPage > 1) echo "<a href='".$_SERVER['PHP_SELF']."?page=".($noPage-1)."'><< Prev </a>";
// memunculkan nomor halaman dan linknya
for($page = 1; $page <= $jumPage; $page++)
{
if ((($page >= $noPage - 3) && ($page <= $noPage + 3)) || ($page == 1) || ($page == $jumPage))
{
if (($showPage == 1) && ($page != 2)) echo "...";
if (($showPage != ($jumPage - 1)) && ($page == $jumPage)) echo "...";
if ($page == $noPage) echo " <b>".$page."</b> ";
else echo "<a href='".$_SERVER['PHP_SELF']."?page=".$page."'>".$page."</a>";
$showPage = $page;
}
}
// menampilkan link next
if ($noPage < $jumPage) echo "<a href='".$_SERVER['PHP_SELF']."?page=".($noPage+1)."'> Next ></a>";
?>
<br><br>