close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Guide or Recipe for DataAssist working with Joins?

Thread began 5/24/2012 1:38 pm by Justin@AdventDesign | Last modified 6/05/2012 9:15 am by Jason Byrnes | 1260 views | 6 replies |

Justin@AdventDesign

Guide or Recipe for DataAssist working with Joins?

Need to have my detail page suggest other products the viewer would 'like', unique to each product. I plan to have a secondary table with the primaryID (the current detailed product) and a secondaryID (multiple products listed). I know on the detail page I'll need to do a join and pull a second recordset based upon those fields.

I'm just not sure how to do the dataassist insert and update page so that the client can list part numbers for the 'like' items and have it write/update both the primary product record and multiple 'like' records for the secondary table.

Is there a Recipe or some type of guide somewhere that would walk me through that setup process?

Sign in to reply to this post

Jason ByrnesWebAssist

no, there is not a tutorial for this.

from the product results page, create a link to the page you set up to insert or update the Like products.


the link should contain a URL parameter that passes the main product ID:

for example.
productslikeInsert.phpid=33


add a hidden form element will capture the URL variable value.

create a repeat region that shows products in the database and a check box next to then that contain the product ID's.

In the multiple insert or multiple update behaviors, set the mainProduct column to use the hidden form element, and set the like product column to use the checkboxes.

Sign in to reply to this post

Justin@AdventDesign

Hmm... I didn't realize there was a multiple insert/multiple update behavior. That all sounds quite simple enough. Bet I could use that too on the results page for a multiple delete I'd like to employ. Thanks.

Sign in to reply to this post

Justin@AdventDesign

Repeated Error When Applying Multiple Updates

I've created a simple page that pulls all records from my related items table (tbLikeItems containing id(key), ParentNo, ChildNo. I insert the data from the ChildNo as the input default value. So far everything works fine. It selects the table with the proper elements using a URL Parameter and repeats the form input blanks just fine.

However, when I add the Multiple Updates behavior and run the page, I get "Parse error: syntax error, unexpected ';' in /Applications/XAMPP/xamppfiles/htdocs/beta/PSDesigns/sitecontrol/tbProducts_RelatedInsert.php on line 64"

I've attached the page.

Attached Files
tbProducts_RelatedInsert.php.zip
Sign in to reply to this post

Justin@AdventDesign

Never Mind! Idiot operator error on my part. Have to click through to the second panel when setting up the Multiple Update. Duh!!!

Sign in to reply to this post

Justin@AdventDesign

Just a little more help.

I've got the admin pages working great for creating and editing the related items table, but I'm struggling with the table join for the front end.

We have an item detail page that needs to display related products. There are two tables to deal with, tbProducts and tbLikeItems. Taking the URL Parameter 'partno' , the MySQL statement would need to select all items from tbProducts where tbLikeItems.ParentNo = the URL Parameter 'partno', and then select various columns from tbProducts where tbLikeItems.ChildNo = tbProducts.partno .

I know this involves a table join, but the part that confuses me is that tbProducts has to be used on both ends of the query, as the identification for primary id (partno) and then returning info from tbProducts that match in the tbLikeItems.

Can anyone give me a rough framework for the query statement?

Tables are as follows:


tbProducts
-------------
id
title
partno (product part number)
various other columns of info...

tbLikeItems
------
id
ParentNo (product part number of the primary item)
ChildNo (product part numbers of the related items to be shown)

Sign in to reply to this post

Jason ByrnesWebAssist

The query would look similar to this:


SELECT tbProducts.*, tbLikeItems.*
FROM tbProducts
INNER JOIN tbLikeItems
ON tbProducts.partno = tbLikeItems.ParentNo
WHERE tbLikeItems.ParentNo = parampartno



variables:
name: parampartno
type: integer
default value: -1
runtime value: $_GET['partno']

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