Jump to content

Master/Detail with URL parameters


Recommended Posts

I have been working on a directory project as my first foray into PHP. I have DWMX2004. This is what I've done so far....

 

I have a table set up in MySQL that lists the usual stuff (name/phone/email/department/location, etc). So far I have created a page that lists the letters of the alphabet as 26 radio buttons in a form. When a person clicks on the letter A and sends it, all the people whose last name starts with A appear in a table on the same page. All of this works just fine. I have managed to create an admin page, an input page, an update page, and a delete record page and they all work. So far so good.

 

Now for the fun part and this is where I'm stuck. I now want to create a page that lists all of the departments along with each's phone number and a link to that department's home page AND a link to the directory. The idea is that maybe you're looking for contact information for a person but you can't remember their name (therefore the alphabet page is usless to you). But you do know where they work. So you go to the department page, click on the directory link next to that department's name and voila, you have everyone listed in that department so you can pick out who you were looking for.

 

It looks similar to this:

President's Office Phone# Fax# Home link | Directory link

Vice Pres's Office Phone# Fax# Home link | Directory link

and so on

 

After pondering on this problem, I thought maybe I should separate the department info from the original table and create another table. I now have a flat file ready listing all the department/phone/fax along with an identifying number for each.

 

I am stuck in that I'm not sure how to pass the department number information to the database via URL to pull out what I need. If I have 75 different departments listed on the same page, does that mean I have to have 75 different recordsets - one for each link? Or can one recordset do the job but in that case, how do I make each link unique based on the department number without using a form w/radio buttons?

 

If I go the master/detail page route, would that work seeing as how the detail I'm wanting can be over a dozen records rather than just one? I can see calling the department listing page the master page but I thought the detail page only had one record. Also, I don't want to list the department page according to department number or alphabetically. It needs to be listed according to an organizational structure that makes it difficult to pull it from a database in any sensical way so I can't create that page using a recordset.

 

I hope this is making sense so ya'll know how to point me in the right direction.

Link to comment
Share on other sites

Yes it would. You can specify exacttly how many records to show maximum. Use the server behaviours panel recordset to wizard to pass the parameter to the next page. The options are in the list boxes. If you press F! there are detailed walkthroughs on how to achieve tihe kind of thing you aim to do. Look in the developing php aplications readily section.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.