query('SELECT * FROM photos LIMIT '.(($page-1)*PERPAGE).' , '.PERPAGE)) {
showError('MySQL error');
}
while($row = $result->fetch_assoc() ){
?>
}
?>
if (!$result = $DB->query('SELECT COUNT(id) AS count FROM photos')) {
showError('MySQL error');
}
$row = $result->fetch_assoc();
$count = $row['count'];
$pcount=ceil($result[0]/PERPAGE);
?>