Copy link to clipboard
Copied
David,
I have used your fantastic book, PHP Solutions to great success in developing my own projects.
My problem is in following your approach for displaying a subset of records from my database. In your book (page 333, php solution 12-4), you use tables, and in my design I am using CSS. Everything works great if I display the entire record set, but when I want to limit the number of records shown on a page, I can't make it work. I'm suspecting that your method using the table was 'self-governing' to the extent that the table was created based on the various parameters of the subset.
I'm not looking for a line-by-line code example, rather I would like to find a resource that might help me shed light on this problem. I have been trying things for hours today, but can not acheive my goal of limiting x-amount of subsets per page.
Any nudge in the right direction would be greatly appreciated.
Sincerely,
wordman
The fact that the thumbnails are displayed in a table is irrelevant. What controls the subset of records being retrieved from the database is the code in step 4 at the top of page 335.
$startRow is the current page number (counted from 0) times SHOWMAX (the number of elements you want to show on the page.
That results in the SQL on page 2 being this: "SELECT * FROM images LIMIT 6, 6". ($startRow is 1 * 6).
Copy link to clipboard
Copied
The fact that the thumbnails are displayed in a table is irrelevant. What controls the subset of records being retrieved from the database is the code in step 4 at the top of page 335.
$startRow is the current page number (counted from 0) times SHOWMAX (the number of elements you want to show on the page.
That results in the SQL on page 2 being this: "SELECT * FROM images LIMIT 6, 6". ($startRow is 1 * 6).
Copy link to clipboard
Copied
David,
Many thanks for the insight. It helped me understand the problem, which was actually related to some additional query logic I am using.
However, my main hurdle still lies in front of me.
I'll post this in a new thread.
Thank you so much!
Sincerely,
wordman