close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

General results page - specific results page - final result

Thread began 2/22/2010 2:41 pm by jeffmg279672 | Last modified 2/23/2010 5:03 pm by Jason Byrnes | 2015 views | 7 replies |

jeffmg279672

General results page - specific results page - final result

I want to set up a page which pulls all instances of a recording artist's name from the database and displays them in a repeat region. Clicking on one of these artist's names will then take you to a second page displaying all recordings by them. Clicking on one of these will then take you to a detail page for that item. Sounds simple enough and I'd assumed I'd be able to do it with DataAssist but I can't work out how to get started with this. I can put together a page which pulls all the artists' names out of the database and then links to a detail page for each one, but the client is insistent on having this three stage selection. Is there a tutorial which might point me in the right direction, please?
Previous experience with DataAssist makes me think that the options are limited to a search page which then feeds into a results page, but ideally what I need is a results page (with the artists' names) which then feeds into a page with all options for that artist, which then feeds into the final detailed results page. If it's possible to do this with DA I'd love to know how.

Sign in to reply to this post

Jason ByrnesWebAssist

you will need 2 tables to accomplish this, an artist table and a recordings table. the recordings table will include a foreign key used to relate the recording to the artist:

artists:
artistID - Primary key
artistName - text
etc.

recordings:
recordingID - Primary Key
recordingArtistID - Foreign Key to artists.artistID
recordingName - Text
etc.

on the first page, create a recordset to return all artists:
SELECT * FROM artists

In the repeat region, display the artists name and linking to a recordings page using a querystring variable to pass the artists ID:
<a href="recordingsResults.php?id=<?php echo $row_recordsetName['artistID']; ?>"><?php echo $row_recordsetName['artistName']; ?></a>




on the recording results.php page, create a recordset to return all of the recordings for the selected artist by filtering the recordingArtistID on the ID querystring variable.

in the repeat region, show the recording name with a link to the recordings detail page passing the recordingID column as a querystring variable:
<a href="recordingsDetails.php?id=<?php echo $row_recordsetName['recordingID']; ?>"><?php echo $row_recordsetName['recordingName']; ?></a>


On the recordingsDetails.php, create a recordset to display the selected recording by filtering the recordingID column on the ID querystring variable that was passed.

Sign in to reply to this post

jeffmg279672

OK. I've set up two tables (I'm testing this locally on my Mac using MAMP and phpMyAdmin). First problem was that I couldn't work out how to assign recordingArtistID as a foreign key in the recordings table to artist.artistID - I've already got a primary key set in both tables and it just kept throwing errors whenever I tried, so at the moment the foreign key is recordingID - couldn't see how to make recordingArtistID the foreign key.

The first page works fine, but the problem comes in the recordingsResults.php page - I think I might have messed up here as it's showing all the results from the database rather than pulling them for a specific artist. Have I misunderstood what you mean by passing the recordingID column as a querystring variable?

Attached Files
Archive.zip
Sign in to reply to this post

Jason ByrnesWebAssist

on the results page, you are not filtering the recordset at all. set the filtering option on the results recordset to filter the artist ID column of the recordings table on the id querystring variable that is being passed.

Sign in to reply to this post

jeffmg279672

OK, I think I see what you mean. I've set it so that the recordset is now being filtered (I think). The SQL from the advanced view of the recordset now reads as follows:

SELECT *
FROM opMrecordings
WHERE recordingArtistID = colname
ORDER BY recordingArtistID ASC

When I test it though I'm getting a blank page with a URL ending like this:
recordingsResults.php?id=4

This is probably really frustrating for you, apologies - it's been a long day here (just after midnight in UK) and I've spent ages trying to get this sorted.

Sign in to reply to this post

Jason ByrnesWebAssist

if you are getting a blank page, it means there is a php error occurring.


add the following at line 1 to turn error reporting on:

php:
<?php

error_reporting
(E_ALL);
ini_set('display_errors','on');
?>
Sign in to reply to this post

jeffmg279672

Added the code at line 1 but still only got a blank page, nothing showed up as an error...

Sign in to reply to this post

Jason ByrnesWebAssist

please send a link and a copy of the page.

Sign in to reply to this post

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