close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Help linking Results page to Details page

Thread began 9/01/2010 7:29 am by willo009412397 | Last modified 2/10/2011 12:14 pm by Jason Byrnes | 1806 views | 13 replies |

willo009412397

Help linking Results page to Details page

Hi
I'm using CS5 and Dataassist2, I'm creating a `pet classifieds` and need some help. I have set up a search and results page which work fine, but now wish too link the results page too a `Details page`..So from the results page the customer can click on the photo or name on the search page and be taken too the Details page where all the details for that animal are shown. Thanks in advance for any help guys

Regards Karl

Sign in to reply to this post

Jason ByrnesWebAssist

on the results page, create a link to the details page that passes the Primary Key ID column as a querystring:

<a href="detail.php?id=<?php echo $row_YourRecordset['IDColumn']; ?>">detail</a>

On the detail page, create a recordset.

In the filtering section, select the ID column

Set the Type to Querystring variable and enter "id" without quotes for the name.

Sign in to reply to this post

John LangerBeta Tester

On your details page create a recordset with the data you want to display. If you click on test in the recordset it should display all the records.

Go to the simple display and in the "filter" dropdown select the unique identifier (usually ID).

Make sure URL parameter is selected. This should auto populate the box next to url parameter with "ID". Please note that I'm just guessing "ID" it's what ever you called the auto increment column of your database. Click OK and close this dialog box

Bind whatever fields you need to the page so it displays your "details".

Go to your results page and highlight some text in the row (or create a "Details" link). Link this to the details page.

Now the tricky bit. Suppose this link is "details.php" you need to add "?id=" and then bind the ID from the recordset on that page so it will look like:

php:
details.phpID=<?php echo $row_rsRecordset['ID']; ?>

Now, if you display the results page in your browser and click on the link it should go to the details page taking the url parameter of the record with it. This will then call the correct record and display it on the page.

HTH

Edit: Ooops, looks like Jason beat me to it :)

Sign in to reply to this post

Jason ByrnesWebAssist

No worries John, It's always appreciated when you guys step in too.

Sign in to reply to this post

willo009412397

1st thanks to you both for a speedy reply too my problem, i have tried what you have said but its not worked for me. I have added the code so you can take a look

<td align="center"><a href="details_page.php?id=<?php echo $row_rs_details[`id`]; ?>">Details</a></td>

When i look at the code the [`id`] part is not turning red which may be the problem

regards Karl

Sign in to reply to this post

Jason ByrnesWebAssist

it's because you are using the tick character "`" instead of the apostrophe or single quote chacter "'"


change your code:

php:
<td align="center"><a href="details_page.php?id=<?php echo $row_rs_details[`id`]; ?>">Details</a></td>



to:

php:
<td align="center"><a href="details_page.php?id=<?php echo $row_rs_details['id']; ?>">Details</a></td>
Sign in to reply to this post

willo009412397

Working like a dream, thankyou very much for your help .

Regards Karl

Sign in to reply to this post

Jason ByrnesWebAssist

Nice, good to hear it's working.

Sign in to reply to this post

willo009412397

Would this be the same if i was getting info from 2 tables which are INNER JOINED using the 'id' value?

Sign in to reply to this post

Jason ByrnesWebAssist

yes, the tick character is only valid as a surrounding character for a table name in MySQL. In PHP, it is not valid to use the tick, you need to use the single quote. It is a difference in the two languages.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...