close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Multiple tables

Thread began 6/08/2010 5:15 pm by timbad2021 | Last modified 7/28/2010 4:28 pm by Eric Mittman | 3075 views | 12 replies |

timbad2021

Multiple tables

When I read about DataAssist, I believe it said it could associate multiple tables, but now that I've purchased it, I can't figure out how to do this since it only lets me select one table in the wizard. Help?

Sign in to reply to this post

Eric Mittman

There is a Manage Relational Tables server behavior that can be used to update a relating table based on what is being inserted into one of the dependent tables. You would use this server behavior on an insert or update page to manage the relating table.

Please describe what you are trying to accomplish and we can try to help you get it going.

Sign in to reply to this post

mark52139

Is there a tutorial to explain this further - i have a project that i need to enter users into a table and then have them pick the categories they are interested in. I have setup the two tables and also setup two Data assist Insert and update.

Table Users
------------
ID
Username
Password

Table Category
--------------
ID
UsersID
Category

but not sure exactly what i have to do with Manage Relational Tables to get the data to sync.

thanks for any help

Sign in to reply to this post

mark52139

Almost there just need some help

ok I am almost there - i found an old tutorial from Interakt (many to many) - been on the forums all weekend and i am almost there.

i setup my databases
1. profile - profileid, username, password
2. profile_category - categoryid, category
3. profile_categorylist - profileid_stc, categoryid_stc

Steps:
1. Insert Record Form
2. setup Recordset - Table profile_category, columns: all
3. setup my checkbox - picked checkbox from toolbar, checked value as:
<input <?php if (!(strcmp($row_Recordset1['categoryid'],WA_AB_returnPreSelectValue($WA_PreSelect_RelationalTable_1, $row_Recordset1['categoryid'])))) {echo "checked=\"checked\"";} ?> name="checkbox_<?php echo $RepeatSelectionCounter_1; ?>" type="checkbox" id="checkbox_<?php echo $RepeatSelectionCounter_1; ?>" value="<?php echo $row_Recordset1['categoryid']; ?>">
4. Applied the Repeat Region

Did a test of Form everything works great pulls the data from the Profile_category table
but insert won't work for profile_categorylist - profileid_stc but does insert for categoryid_stc

here is what i did for manage relational Table
Step 1: relational table: profile_categorylist
Step 2(where i think problem is): Foreign key column is profileid_stc, Data type: Numeric, key value: <?php echo $_SESSION['profileid']; ?>
Step 3: Foreign key column: categoryid_stc, Data type: Numeric, Option form field: 'checkbox' in Repeat selection (Recordset 1, 1)

pulling my hair out why i can't get the profileid to insert into profileid_stc in the profile_categorylist - PLEASE HELP!!!!!!!!!!! i can forward you files and databse if that helps

url of reg - profile_Registration.php

Sign in to reply to this post

mark52139

Hello Just need a quick response from somebody at Webassist to point me in the right direction - Please - should i not be adding the MRT to the Registration Page?

Sign in to reply to this post

Eric Mittman

So long as the insert into the profile table is occurring first and you are storing the newly inserted id in the session variable called profileid you should be inserting this id with the manage relational table server behavior.

Have you done any testing to ensure that you have this session variable properly set before the MRT server behavior runs? I would like to take a look at your page to see if I can spot an issue and help you debug what is occurring. Please post back with the page in question in a zip archive so that we can take a look.

Sign in to reply to this post

mark52139

Thank you for the help

Here is the whole site -
profile_Registration.php is where i put the MRT.
profile_Profile.php is where the update of that would happen. If you need the connection file please let me know how i can post private.

I think i do but not 100% sure. Thanks for any help you can provide - I have done this before with Interakt but that was a long time ago.

Originally Said By: Eric Mittman
  So long as the insert into the profile table is occurring first and you are storing the newly inserted id in the session variable called profileid you should be inserting this id with the manage relational table server behavior.

Have you done any testing to ensure that you have this session variable properly set before the MRT server behavior runs? I would like to take a look at your page to see if I can spot an issue and help you debug what is occurring. Please post back with the page in question in a zip archive so that we can take a look.  
Attached Files
webassist.zip
Sign in to reply to this post

Eric Mittman

Thanks for posting back with the pages, this helps a bunch. When I view your registration page I can see that you are setting the id for the master table in the MRT to this value:

php:
$WA_masterKeyValue = "".$_SESSION['profileid']  ."";



I can see the insert server behavior that you have on the page but I do not see anywhere that this session variable is being set. You will need to have this session variable set in order to make use of it in the MRT. The best way to do this would be to replace the insert server behavior that you have on the page with the DataAssist Insert server behavior. When you add this in you would specify what columns get what values from the form and also you will be able to choose the id column and have it stored in a session variable. So long as you call the session variable profileid it should work with the MRT on the page.

Sign in to reply to this post

mark52139

awesome that works - thanks so much!!!!!!!!1 - very easy fix

can you give me a hint on how i would now setup the update page so the user can update their categories and profile - Do i try to build onto profile_Profile.php (no update behavior) or just a new update behavior on new page?

Sign in to reply to this post

mark52139

Can you take a look at my profile page? - i got everything working to update but i can't get the check boxes (Category)to update to the selections they made or submit the new selections. I understand this is probably beyond the help you offer but if you can just lead the way - I am thinking it is a record set problem - not sure what to filter the profile_category table by - no option for the profileid?

Attached Files
profile_Profile.zip
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...