close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Linking to a product in the database

Thread began 6/10/2009 5:35 pm by paul.urgero235355 | Last modified 6/12/2009 10:38 am by Ray Borduin | 5671 views | 13 replies |

Paul

Linking to a product in the database

On the home page, I want to link one of the thumbnails to a particular product. I've created a recordset for the "products".

Here is my code...where do I tell it the particular item number?

<a href="/Products_Detail.php?<?php echo $row_rsProducts['ProductID']; ?>=<?php echo $row_rsProducts['ProductID']; ?>"><img src="Images/featured_1.jpg" alt="Placeholder" style="float:left; margin-right:10px;" /></a>

Thanks
Paul

Sign in to reply to this post

Ray BorduinWebAssist

It should be:

<a href="/Products_Detail.php?ProductID=<?php echo $row_rsProducts['ProductID']; ?>">

and then you can use $_GET['ProductID'] to reference the product on the product details page.

Sign in to reply to this post
Did this help? Tips are appreciated...

Paul

Ray,

Can you send me a link to somewhere that I can see exactly how it is done with your extensions?

Thanks

Sign in to reply to this post

Ray BorduinWebAssist

This isn't actually done with our extensions. This is just a common php and Dreamweaver concept.

Our extensions don't help you add a url parameter to a link, or to filter a recordset by a url parameter... that is built in DW functionality and a common concept throughout all server languages not just php.

Where do you get stuck? Adding the parameter? Filtering a recordset with the parameter?

Sign in to reply to this post
Did this help? Tips are appreciated...

Paul

i can get the results page to be linked and come up...but it is how to get the exact product to show in the results page. i guess it is basic stuff.

thanks.

Sign in to reply to this post

Ray BorduinWebAssist

Open up the recordset in Simple view

Then choose from the filter dropdown to filter by the url parameter and type in the name of the parameter you are using.

Sign in to reply to this post
Did this help? Tips are appreciated...

Paul

Ray,

Thanks...when I tested it in Simple view, it showed the correct item. But when the details page opened, it showed no results. Here's the code:

<p><a href="/Products_Detail.php?ProductID=<?php echo $row_rsProducts['ProductID']; ?>"><img src="Images/featured_1.jpg" alt="Placeholder" style="float:left; margin-right:10px;" /></a></p>

Thanks

Sign in to reply to this post

Ray BorduinWebAssist

What does the url look like when you click on it in the browser? Does it look correct there? Are you using the same exact parameter name "ProductID" case sensitive?

Sign in to reply to this post
Did this help? Tips are appreciated...

Paul

When the results show up, or even when I hover over the original link, it shows the following:

Products_Detail.php?ProductID=

So somehow, somewhere, I have the ID in the wrong place.

When I go into the recordset (rsProducts), I have the Products Table, with ALL the columns selected. The filter is: ProductID =, the URL Parameter is 31 (which is the ProductID that I want), and Sort is NONE.

When I test it, it shows fine, but it doesn't come up on the details page, or in the link on the home page.

Thanks

Sign in to reply to this post

Ray BorduinWebAssist

That means the problem is with the code linking to the page:

<a href="/Products_Detail.php?ProductID=<?php echo $row_rsProducts['ProductID']; ?>">

specifically:
<?php echo $row_rsProducts['ProductID']; ?>

that column reference or database reference must not be correct....

when it works the url will look like:
Products_Detail.php?ProductID=27

Sign in to reply to this post
Did this help? Tips are appreciated...
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...