So I have a database, with a table in it. In the table, there's only one "ID" field
what I want to do is to display the ID individually on my page, starting from ID=1. and when I click a button, the next ID will be displayed (ID=2, ID=3, .. each button click)
So this is my code
$id = (isset($_GET['id']) ? intval($_GET['id']) : 1);
$result = $db->query("SELECT * FROM id_table WHERE id>='$id' ORDER BY id ASC limit 2 ");
$row = $result->fetch_assoc();
<form action="" method="POST">
<button onclick="" class="btn btn-primary btn-xl">Next</button>
ID is successfully displayed. But I've been struggling to make a working next button.
If this is a bad coding, please let me know and point me in right direction, so I can fix my mistakes. Thank you in advance, have a great day!