Background:
I am currently working on a project to covert hundreds of static HTML pages into a PHP/mySQL, pseudo, CMS.
The HTML pages are in to main categories, Case Studies and Floor Plans, with multiple sub-categories (sub-cats are the same in both main-cats).
Something like:
+Case Study
+Health Care (this page is a complete study outline list)
- this building 1 (individual study)
- this building 2
+Floor Plan
+Health Care (this page is a complete plan outline list)
- this building 1 (individual plan)
- this building 2
I thought it best to start with building the PHP page with all my select statement, pagination and HTML output, for testing.
I then added my sql dump and viola it worked like a charm for both categories (individually in separate files).
Now I'm at the point to combine the script and use Case (Switch) to determine what Category to show.
And of course this is where everything has to go wrong!
The Problem:
Unfortunately I don’t see what is causing the problem, despite having looked over the code a few dozen times.
What I know is happening is, on Case 2, the correct content is displayed but the pagination is wrong.
There are only 2 records set with values equaling Floor Plans and the pagination is set to display 3 per page and not show links to next or page 2 if there are less than 3 records.
Here’s my code and sql dump. (Attached)
Perhaps someone here could be so kind as to show me my errors?
Additionally I am open to suggestion or examples of how to shorten my code and maintain functionality.
Thanks in advance.
NOTE:
index.txt (index.php)
menu.txt (navigation menu, use the navigation to open index.php via case or URL string it manually)
sql.txt (sql dump)