I am developing with php and mysql for the backend. I have a table [books] with more than 10 rows. I want to view each book and its properties on the page. When I click the NEXT button, it should display another book and its properties. When I click the BACK button, it should return to the previous book.
Using:
while($row = mysql_fetch_array($query_string)){
echo "<tr><td>Title</td>
<td>". $row['title']. "</td></tr>".
"<tr><td>Date</td>".
"<td>".$row['datePub']."</td></tr>";
}
will print out all the rows.
How can I iterate through each row using a button's clicked event perhaps?
thank you all.
You can use an AJAX request to get the needed data for your page.
If you don't want to use AJAX you can always get all the data from the database and filter it with a page count that you can pass as GET parameter.
The advantage with the first solution is that you don't have to reload the whole page.