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?
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?
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.
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
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
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?
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.
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.
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:
$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.
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?
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?
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
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.