Copy link to clipboard
Copied
This question is based around a simple master - detail page set.
Environment is Windows XP - Dreamweaver CS5 - Apache - MySQL - PHP (all should be up to the latest levels)
This is all under a local server environment.
I have a single table in MySQL with about 12 columns/fields. The Master page lists 2 columns ('Name' and 'DateOfArrival' - both CHAR columns) in a repeating group. The Detail page is selected by clicking on the 'Name' column of the row required. It displays the contents of all the columns for this record.
I've based the coding based on the Master - Detail example in 'Adobe Dreamweaver CS5 Classroom in a book'.
The coding works when the 'Name' column is unique. However, the 'DateOfArrival' column is used to make the record unique and needs to be passed with the 'Name' column. I seem to have tried most combinations (over the last 5 hours) but am obviously doing something wrong. The last attempt had the Link field set to
EllisIslandDetail.php?Name=<?php echo $row_rsEIList['Name']; ?>&DateOfArrival==<?php echo $row_rsEIList['DateOfArrival']; ?>
where EllisIslandDetail.php is the Detail page
rsEILIST is the record set associated with the Master page.
Hope someone can set me in the right direction on what is probably a very simple error.
Thanks
Cliff
Copy link to clipboard
Copied
>The coding works when the 'Name' column is unique.
>However, the 'DateOfArrival' column is used to make the
>record unique and needs to be passed with the 'Name' column.
That's a good reason to always use surrogate primary keys. Can you alter your table to use a single, unique key like an autoincrement number? It's also a bad idea to use an intellegent key like 'name' as a primary key part.
>EllisIslandDetail.php?Name=<?php echo $row_rsEIList['Name'];
>?>&DateOfArrival==<?php echo $row_rsEIList['DateOfArrival']; ?>
I don't know php, but is there a reason for the double "==" in there?
Copy link to clipboard
Copied
Thanks for the quick response.
I know under third normal form the key should have been unique but I was hoping that it would work without duplicating data or setting up artificial keys. At any rate your reply provided a working solution (and thanks again).
The second '=' was put in by Dreamweaver. When I spotted it the first time I removed it but then Dreamweaver reinserted the code.
Cliff