', $body);
print "
$title
$body";
$query_artist = "SELECT * FROM post_more_picture WHERE art_id = '$id' AND art_cat=''";
$result_artist = mysqli_query($conn,$query_artist) or die(mysqli_error($conn));
while($info = mysqli_fetch_array($result_artist))
{
$filename=$info['filename'];
$detail=$info['detail'];
print "
$detail

";
}
print '
';
}
*/
?>
';
while($info = mysqli_fetch_array($result))
{
$id=$info['id'];
$detail=$info['detail'];
$filename=$info['filename'];
$url_link=$info['art_cat'];
if($url_link !== ""){
print "
$detail
";
}elseif($filename !== ""){
print "
$detail
";
}
}
print '';
}
// how many rows we have in database
$query = "SELECT COUNT(id) AS numrows FROM post_more_picture WHERE art_id = ''";
$result = mysqli_query($conn,$query) or die(mysqli_error($conn));
$row = mysqli_fetch_array($result);
$numrows = $row['numrows'];
// how many pages we have when using paging?
$maxPage = ceil($numrows/$rowsPerPage);
// print the link to access each page
$self = $_SERVER['PHP_SELF'];
$nav = '';
for($page = 1; $page <= $maxPage; $page++)
{
if ($page == $pageNum)
{
$nav .= " $page "; // no need to create a link to current page
}
else
{
$nav .= "
$page ";
}
}
// creating previous and next link
// plus the link to go straight to
// the first and last page
if ($pageNum > 1)
{
$page = $pageNum - 1;
$prev = "
[Prev] ";
$first = "
[First Page] ";
}
else
{
$prev = ' '; // we're on page one, don't print previous link
$first = ' '; // nor the first page link
}
if ($pageNum < $maxPage)
{
$page = $pageNum + 1;
$next = "
[Next] ";
$last = "
[Last Page] ";
}
else
{
$next = ' '; // we're on the last page, don't print next link
$last = ' '; // nor the last page link
}
// print the navigation link
echo "
".$first . $prev . $nav . $next . $last."
";
?>