• Comunidad global
    • Idioma:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Comunidad dedicada para hablantes de japonés
  • 한국 커뮤니티
    Comunidad dedicada para hablantes de coreano
Salir

Two values to detail page

Principiante de comunidad ,
Oct 12, 2010 Oct 12, 2010

Copiar vínculo al Portapapeles

Copiado

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

TEMAS
Aplicaciones del lado del servidor

Vistas

398

Traducir

Traducir

Informe

Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
LEYENDA ,
Oct 12, 2010 Oct 12, 2010

Copiar vínculo al Portapapeles

Copiado

>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?

Votos

Traducir

Traducir

Informe

Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Principiante de comunidad ,
Oct 14, 2010 Oct 14, 2010

Copiar vínculo al Portapapeles

Copiado

MÁS RECIENTES

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

Votos

Traducir

Traducir

Informe

Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines