PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hello everyone.
I have a page that filters products by character such as size,price etc..
I would like to split the results into pages 1,2,3 and so on.
I tried to do that but I failed, so I need you guys for that:
First of all I need to know how many results I have to calculate the amount of pages and that's a problem since I limit the query to 20 results.
The solution I'm using is just sending another query without a limit and use the "mysql_num_rows" - if you have more efficient way to do that I would like to know.
In this stage we know how many results I have, so I will probably run a loop to print all the pages (results/results_per_page). Now the problem is what would be the href value? I will show you few example of possible URL's before I click the next page button:
tnrh1 wrote:The solution I'm using is just sending another query without a limit and use the "mysql_num_rows" - if you have more efficient way to do that I would like to know.