Avatar of ES-Components
ES-Components
Flag for United States of America asked on

Is there a line of php code that I can use on a web page to go to the detail record on another web page?

Example: Webpage1 has: ItemNumber, Descritpion, Lot#
                                                         1                  Dog          A2233
                  Webpage2 has: ItemNumber, Descripion, Lot#,    Customer, Quantity
                                                         1                  Dog         A111    Cust1               2
                                                         2                  Dog         B111    Cust2               5
                                                         1                  Dog         C111    Cust3               4

I would like the user to be able to click on the ItemNumber in Webpage1 and have Webpage2 open and display all of the
same ItemNumbers  that the user selected.

In the above example, if the user clicked on ItemNumber 1, it would display 2 results ( ItemNumber1  Dog    A111   Cust1      2
                                                                                                                                                          itemNumber1  Dog    C111   Cust3       4 )
Is there a php code that would do this?

Thank you...
Rick
PHPAdobe Dreamweaver

Avatar of undefined
Last Comment
Jason C. Levine

8/22/2022 - Mon
Jason C. Levine

Dreamweaver should be able to create a Master-Detail recordset via a wizard...look for it.

But the more manual way to do it is to pass the ID number through the URL. So the code on the item number column would look like this:

<a href="yourdetailpage.php?id=<?php echo $row_rsYourRecordSet['idnumbercolumn']; ?>"><?php echo $row_rsYourRecordSet['idnumbercolumn']; ?></a>

That will produce a link that looks like:

yourdetailpage.php?id=1
yourdetailpage.php?id=2
yourdetailpage.php?id=3
etc

On yourdetailpage.php, you create a new recordset via Dreamweaver that filters on the URL Variable "id"
ES-Components

ASKER
I entered below.  When I enter Webpage 1 the field for the partnumber is blank. There is nothing to click on..

SalesHistory is my detail records. Recordset Name= RaytheonHistory, Query Table= RaytheonSales, Column Name= PartNumb

Webpage 1 = FindDetail,  Recordset Name= RaytheonLots, Query Table= RaytheonLots,
Column Name= VPN

Any Suggestions?


<a href="saleshistory.php?id=><?php echo $row_rsRaytheonHistory['PartNumb']; ?>"><?php echo $row_rsRaytheonLots['VPN'];?></a>
Jason C. Levine

So what's VPN?  Should be PartNumb again inside of the <a></a>
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
ES-Components

ASKER
There are two tables that have a PartNumb in it. ( SalesHistory, and Find Detail)

The Column Name in FindDetail is VPN. This Column Name would be equal to SalesHistory Culomn Name PartNumb.

I guess, what I do not understand is how you match the two tables together with different tables and column names?


SalesHistory is my detail records. Recordset Name= RaytheonHistory, Query Table= RaytheonSales, Column Name= PartNumb

Webpage 1 = FindDetail,  Recordset Name= RaytheonLots, Query Table= RaytheonLots,
Column Name= VPN
Jason C. Levine

Which version of Dreamweaver is this?
ES-Components

ASKER
I am using Dreamweaver MX2004.
I have access to Dreamweaver CS6 but this is still not functional yet at our company
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Jason C. Levine

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ES-Components

ASKER
I am giving you the solution. Thanks for the quick response.
It is NOT the solution that I need. I can easily do this in ASP in Dreamweaver using "Go To Detail Page." That funtionality only works in ASP in Dreamweaver, NOT php.

Your solution is okay, but it does not display the way we need it.

Thanks again for all your effort!
Rick
Jason C. Levine

That funtionality only works in ASP in Dreamweaver, NOT php.

It works fine in PHP, people have been using DW to write PHP code for years....you need to declare the site to be PHP/MySQL and define a testing server.

If you can get it to write the code, you will see how my answer above applies.  It's just a matter of creating a query string in the URL and then consuming that query string on the detail page and using it to output the correct row from the table.