$notesOnPage = 6;
$result = mysqli_query($connect, "SELECT * FROM malyar_master ");
$count = $result->num_rows;
$pageCount = ceil($count / $notesOnPage);
for ($i = 1; $i <= $pageCount; $i++) {
if ($page == $i){
$class = " class='active'";
} else $class = ' class=""';
echo "<p><a href=\"?page=".$i."\"$class>$i</a></p>";
}