Pagination ordered by ID

Asked

Viewed 44 times

0

I have this system as a menu

inserir a descrição da imagem aqui

How can I get him to pass the products and return through the ID saved in the bank?

<nav class="slider__nav">
<button class="button button--nav-prev"><i class="icon icon--arrow-left"></i><span class="text-hidden">Prev</span></button>
<button class="button button--zoom"><i class="icon icon--zoom"></i><span class="text-hidden">View</span></button>
<button class="button button--nav-next"><i class="icon icon--arrow-right"></i><span class="text-hidden">Next</span></button>
</nav>

If I click Next presents me the 2 and so on. And step back in case Prev is selected.

  • My tip would be, store the current id in a local variable and increase and use this variable to return the respective product

  • I would have some tutorial or something like I’m learning but I only found something like paging but it does the total count and I need one at a time. not to harm the view. I tried but did not give me the second. The result only overwritten the second when I opened the view of the first one. if you can take a look at the execution. http://imperionutry.esy.es/aula/index_prod_acao.php

  • Well I have no idea how to do in php, nor do I have to demonstrate the code but I can demonstrate the idea. If I were to do it I would declare a variable at the beginning of the php script. And whenever they clicked the button Next I was gonna add +1 variable and call a query sql type SELECT * FROM produtos WHERE ID in ($idAtual) and present the information.

  • If it is a common pagination, but with the exception that it is only one record per page, which database do you intend to use? Will this page exchange use a synchronous or asynchronous call, post or get? Take a look at this article to see if it clarifies a little more about http://blog.thiagobelem.net/understanding

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.