close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Sub Catagories and recordsets

Thread began 9/22/2009 7:20 pm by martin317528 | Last modified 9/24/2009 12:03 pm by Jason Byrnes | 974 views | 4 replies |

martin317528

Sub Catagories and recordsets

I'm trying to add categories and sub catagories to an ecommerce site. I'm pretty sure the tables in the database are correct from following the blue_sky_music examples. I've been following various threads (showthread.php?t=2785&highlight=modify+product+insert+update+pages) trying to fathom the correct way to customise DA to add Sub Categories. I'm even reading "Database Designs Solutions" by Rod Stephens and MySQLs Work Bench as recommended to get up to speed but I'm running out of time on what should be a simple task - getting the insert and update pages configured correctly. I've created the required files in DA but when I add and change the recordsets I either get multiple entries in the lists on these pages and/or it refuses to see the current record correctly in the details page. Is there anywhere to follow how to configure the insert and update pages and update the server record behavior?

Using latest DA, eCart, CS4, PHP on a Linux server upoaded from an Intel Mac running OS X (10.5.8)

Sign in to reply to this post

martin317528

Simplifying the question

A re run of DA Wizard using the menu options (using the lightning bolt to choose the different tables) for the categories works well. I now have insert and update pages with menus of 3 categories that are populating the database properly. I just can't see how to get the details page to show the correct labels (Cat IDs are right). I've tried adding the tables to the existing recordset. I've tried adding new recordsets copying how they work on update and insert pages. I've tried adding dynamic text from different per page. Just need the method to display the same result as the insert and update pages on the details page (albeit not as a menu)

Sign in to reply to this post

Jason ByrnesWebAssist

On the detail page you will need to modify the recordset to use a joined query to return data from all of the tables. Once the recordset has been modified to return the text from the related tables, where the ID column is being displayed, replace it with the label column.

On the detail page, double click the Recordset. You will need to change the SELECT .... FROM portion, but leave the WHERE clause as is.

To Create a Joined QUERY, start with the select statement:

SELECT maintable.*, childTable1.*, childTable2.*, childTable3.*

This will select all columns from the 4 tables you wish to use. the From clause is the tricky part:


FROM mainTabel
INNER JOIN childTable1 ON mainTable.FKColumnForChildTable1 = childTable1.ID
INNER JOIN childTable1 ON mainTable.FKColumnForChildTable2 = childTable2.ID
INNER JOIN childTable1 ON mainTable.FKColumnForChildTable3 = childTable3.ID


To read more on joined queries, see the following page:
sql_join.asp

Sign in to reply to this post

martin317528

Result!

Jason, you are a genius!

That works a treat (with a minor change to lines 2 and 3)

FROM mainTabel
INNER JOIN childTable1 ON mainTable.FKColumnForChildTable1 = childTable1.ID
INNER JOIN childTable2 ON mainTable.FKColumnForChildTable2 = childTable2.ID
INNER JOIN childTable3 ON mainTable.FKColumnForChildTable3 = childTable3.ID

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

Great, glad to hear it helped.

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