I am trying to make a scroll bar that loads only a select amount of elements at a time. Lets say i have 45 elements to show and one line for each element. I want to load the first 15 then scroll and then load another set of 15 element and so on and so forth.
This is currently written in a .php file and I am using a Div with the following "settings"
print("<div class='scrolldiv' style='width: 70vw; height: 90vh; overflow-y: scroll; margin-top: 4vh; margin-left: 4vw;'><table><hr><th>Set ID</th><th>Set Name</th><th>Category Name</th></hr> </div>");
All code is extremely WIP(work in progress)
<?php include("navbar.php");
?>
<?php
// Cencored the connection :)
$connection = mysqli_connect("Database","data","","data");
$search = $_GET['search'];
$limit = $_GET['limit'];
if ($limit == 0){
$limit = 13361;
}
$counter = 0;
$result = mysqli_query($connection,
"SELECT * FROM sets LIMIT $limit");
print("<div class='scrolldiv' style='width: 70vw; height: 90vh; overflow-y:
scroll; margin-top: 4vh; margin-left: 4vw;'><table><hr><th>Set ID</th>
<th>Set Name</th><th>Category Name</th></hr> </div>");
while ($row = mysqli_fetch_array($result)){
$SetID = $row['SetID'];
$Setname = $row['Setname'];
print(" <div class='row'> <tr>
<td>$SetID</td> <td>$Setname</td>
<td>$Quantity</td></tr> </div>");
$counter = $counter + 1;
$i = $i + 1;
} // end while
echo $counter;
print("</table></div>");
?>
</body>
</html>