Good day!

How can i display the data from Mysql with the least value of primary key and when a user clicks the next button the next to the least data will appear and then the next and so on?

Please help me here, thanks!

MySQL includes a LIMIT function which you can use like so:

select * from my_table
order by my_key asc
limit (0,1)

This will display one record starting at index 0 (ie the first record returned). If you said LIMIT(10,5) it would display five records starting at index 10 (items 11-15).

So what you could do is keep a track of which record they are up to, and when the press the button increment the first parameter in your LIMIT clause.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.