Jump to content

Complex next prev


phlackee

Recommended Posts

HI All!

I have 3 tables:

Category, Project , Entry .

Category have CatId as PK
Project have ProId as Pk and CatId as FK
Entry have EntId as Pk, ProId as Fk and Catd as FK

How to make a Next Prev links that if you are in

view.php?CatId=11&ProId=22&EntId=111

when you choose next, it goes and check who is next record from same category and same project and display,e.g.
view.php?CatId=11&ProId=22&EntId=112

if there is no entry in that project go to next project , first entry, then dispay entry,

view.php?CatId=11&ProId=23&EntId=113

and if there is no project in that category display next category with first project and first entry.

view.php?CatId=12&ProId=24&EntId=114
thanks.
Link to comment
https://forums.phpfreaks.com/topic/31619-complex-next-prev/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.