Forums
This topic is locked
Changing links
27 Jul 2006 18:43:50 paul de posted:
Hello,I have a page that has a number of links on it related to different clients, call this Link Page (shown below). There are a number of links on this page relating to different clients (ClientA, ClientB, ClientC etc). If you click on the link ClientA, you get taken to the Basic Information Page for ClientA (which is populated from a MySql Database). If you click on ClientB, you get taken to the same Basic Information Page but it contains information from the database relating to ClientB, and so on.
This is all fine at the moment. My problem is with the links on Basic Information Page for each client. Let's say you clicked on ClientA on the Links Page, you are now looking at the Basic Information Page - ClientA, with data related to ClientA only. I now want to make MainInfo and SecondaryInfo so that when you click them it takes you to the relevent pages and populates those pages with data from MySQL about ClientA. But, I you were on the Main Information Page and you were ClientB, your data would be filled in (which I can do) but again, I want the links on this page now to have changed so that they go to the other pages and fill in data relating to ClientB only.
So all I need to know is how do I get my page to go, well Basic Information Page = ClientA, therefore the links on this page must go to pages that will be populated with data about ClientA. Or ok, Basic Information Page = ClientB, therefore the links on this page must go to pages that will be populated with data about ClientB and so on...
Any help is greatly appreciated.
Link Page
ClientA ClientB ClientC
Basic Information Page - ClientA
MainInfoClientA SecondaryInfoClientA
Main Information Page - ClientA
Data related to ClientA
Edited by - pademar on 27 Jul 2006 19:09:10
Replies
Replied 27 Jul 2006 19:15:33
27 Jul 2006 19:15:33 Roddy Dairion replied:
Best thing to do is have in the mysql database table the Info on client A using an ID. for e.g. you have a table called clients which will hve as fields Client_ID, ClientName. then another table called Main_Info which will hve as fields info_id, Client_ID, info1, info2, info3 etc... so on your page you have the list of all the clients name which was populated from the clients table. Making the clients name a link you will pass a param in it which will the Client_ID. so you link will look like this Basic_Information_Page.php?client_id = Client_ID field. e.g. Basic_Information_Page.php?client_id = 1, then in the page Basic_Information_Page.php you will have a query which will interogate the table to find out all the details that has Client_ID = 1. Then you will get all the details for client1. You do as many page as you want with the same parameter client_id. And on each page execute a query that will interogate the appropriate table to extract all details having Client_ID = 1. Now if you have 5 tables which you need to retrieve the clients details you need the link between them which is Client_ID so in all the table have a field called Client_ID.