cjkeane Posted February 19, 2011 Share Posted February 19, 2011 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. Link to comment https://forums.phpfreaks.com/topic/228231-veiwing-multiple-pages-of-details-for-a-record-based-on-id-number/ Share on other sites More sharing options...
BlueSkyIS Posted February 19, 2011 Share Posted February 19, 2011 add quotes around the variable in the SQL" "SELECT * FROM records WHERE IDNumber='$IDNumber'" Link to comment https://forums.phpfreaks.com/topic/228231-veiwing-multiple-pages-of-details-for-a-record-based-on-id-number/#findComment-1176949 Share on other sites More sharing options...
cjkeane Posted February 19, 2011 Author Share Posted February 19, 2011 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'" Link to comment https://forums.phpfreaks.com/topic/228231-veiwing-multiple-pages-of-details-for-a-record-based-on-id-number/#findComment-1176952 Share on other sites More sharing options...
litebearer Posted February 20, 2011 Share Posted February 20, 2011 Show what you have tried and tell us what it did or didn't do Link to comment https://forums.phpfreaks.com/topic/228231-veiwing-multiple-pages-of-details-for-a-record-based-on-id-number/#findComment-1176979 Share on other sites More sharing options...
cjkeane Posted February 20, 2011 Author Share Posted February 20, 2011 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. Link to comment https://forums.phpfreaks.com/topic/228231-veiwing-multiple-pages-of-details-for-a-record-based-on-id-number/#findComment-1177348 Share on other sites More sharing options...
litebearer Posted February 20, 2011 Share Posted February 20, 2011 Consider using session variables Link to comment https://forums.phpfreaks.com/topic/228231-veiwing-multiple-pages-of-details-for-a-record-based-on-id-number/#findComment-1177350 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.