I have a website I'm working on and it all works just fine. I'm concerned that under load the way I am doing things currently could cause some server lag.
In the database I have a table with a lot of information in it (14+ columns and several hundred entries). The PHP page has a script on it to generate page links (Page 1 of 6, next page, previous, first, last, etc.). It currently displays 25 entries per page. The script multiplies the page number by 25 to get which entry in the table it needs to start on for the select.
That's not too horrible I don't think. The real issue comes from the "Page x of y". Meaning that I need to know how many pages of items there will be, or how many times 25 goes into the number of entries. I've done this by using something like:
SELECT count(id) FROM `footwear`
to just get the count of entries in the table. Then using that count I can calculate all my pages. Is that the most efficient way of doing things? Or perhaps there's a better way to calculate the page count?