Jump to content

Veiwing multiple pages of details for a record based on ID number


cjkeane

Recommended Posts

Hi Everyone.

 

i have a page which list all records. i then have several detail pages which i need to link via the id number. for ex.

 

records:

id number name

1 john smith

2 peter parker

 

the detail page is layout out like so:

View details page 1 | view details page 2 | view details page 3

 

Any help would be appreciated. Thanks.

 

 

I had just figured that out before receiving your reply .. thank you. but I have a further issue linking multiple pages to that ID number and i'm not sure how to go about it. Any ideas?

 

add quotes around the variable in the SQL"

 

"SELECT * FROM records WHERE IDNumber='$IDNumber'"

I have a page listing records like so.

 

id name address

1 John smith 12455 1st Ave

 

when the id number is clicked, it takes the visitor to a page where they edit that clients info. That works just fine.

 

i pass the id number to the page like so:

<?php echo $IDNumber; ?>

The id number is displayed.

 

i then have tried creating a hyperlink on other pages to display other related data based on the same id number. i have tried using:

 

<a href="er_extradata1.php?IDNumber='$IDNumber'">Extra Data Page 1</a>

 

I have several data pages, so i'll need links to work like so:

<a href="er_extradata1.php?IDNumber='$IDNumber'">Extra Data Page 1</a>

<a href="er_extradata2.php?IDNumber='$IDNumber'">Extra Data Page 2</a>

<a href="er_extradata3.php?IDNumber='$IDNumber'">Extra Data Page 3</a>

<a href="er_extradata4.php?IDNumber='$IDNumber'">Extra Data Page 4</a>

 

What i'm getting displayed on the address line is:

er_extradata.php?IDNumber=$IDNumber

 

I have also tried:

<a href="er_extradata.php?IDNumber=<?php echo $IDNumber; ?>"

 

But i'm getting:

http://localhost/testsite.com/er_extradata.php?IDNumber=%3Cbr%20/%3E%3Cb%3ENotice%3C/b%3E:%20%20Undefined%20variable:%20IDNumber%20in%20%3Cb%3EC:\wamp\www\testsite.com\er_extradata.php%3C/b%3E%20on%20line%20%3Cb%3E139%3C/b%3E%3Cbr%20/%3E

 

i need it to show the related data so the link must be:

er_extradata.php?IDNumber=1

 

Any ideas on how to get this to work?

Thanks.

Archived

This topic is now archived and is closed to further replies.

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