How to display different table in different page on PHP?
Posted: Tue Mar 29, 2011 12:45 am
I have a PHP web-page contains few dynamic tables.
For example, I have 5 different categories of database tables: Math, Physic, Chemistry, Biology, and History.
I retrieve them onto my PHP page, and for loop them into 5 different HTML tables for categories:
Math Table, Physic Table, Chemistry Table, Biology Table, and History Table
Now, I would like to do paging on each categories. First page is Math table. There is a [Next] button at the end to click and goes to second page which is Physic categories with record-set display on table again. Second page has [Previous] and [Next] button for navigation again.
From:
----------
| Math |
----------
----------
| Physic |
----------
----------
| Chem |
----------
----------
| Bio |
----------
----------
|History |
----------
Switch into:
---------- ---------- ---------- ---------- ----------
| Math | | Physic | | Chem | | Bio | |History |
---------- ---------- ---------- ---------- ----------
page 1 page 2 page 3 page 4 page 5
But, if ANY table's record is empty:
---------- ---------- ----------
| Math | | Chem | | Bio |
---------- ---------- ----------
page 1 page 2 page 3
I would like to make them in ONE PHP web-page, is it possible? I have tried to display them into 5 separated Table tag on ONE page. Now I would like to separate each category into different page.
Next, how can I read empty record-set return Table and do not displaying it?
For example, Math table has records, but Physic table has no record, so my [Next button] on Math category will be posting the page=2 and find Chemistry page as Chemistry table has records.
I need the guidance urgently. I am using PHP and MySQL only, can I doing this without JavaScript or Java related script?
For example, I have 5 different categories of database tables: Math, Physic, Chemistry, Biology, and History.
I retrieve them onto my PHP page, and for loop them into 5 different HTML tables for categories:
Math Table, Physic Table, Chemistry Table, Biology Table, and History Table
Now, I would like to do paging on each categories. First page is Math table. There is a [Next] button at the end to click and goes to second page which is Physic categories with record-set display on table again. Second page has [Previous] and [Next] button for navigation again.
From:
----------
| Math |
----------
----------
| Physic |
----------
----------
| Chem |
----------
----------
| Bio |
----------
----------
|History |
----------
Switch into:
---------- ---------- ---------- ---------- ----------
| Math | | Physic | | Chem | | Bio | |History |
---------- ---------- ---------- ---------- ----------
page 1 page 2 page 3 page 4 page 5
But, if ANY table's record is empty:
---------- ---------- ----------
| Math | | Chem | | Bio |
---------- ---------- ----------
page 1 page 2 page 3
I would like to make them in ONE PHP web-page, is it possible? I have tried to display them into 5 separated Table tag on ONE page. Now I would like to separate each category into different page.
Next, how can I read empty record-set return Table and do not displaying it?
For example, Math table has records, but Physic table has no record, so my [Next button] on Math category will be posting the page=2 and find Chemistry page as Chemistry table has records.
I need the guidance urgently. I am using PHP and MySQL only, can I doing this without JavaScript or Java related script?