close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Using Data Assist with Relational Databases

Thread began 10/21/2012 3:44 am by thehalpeen319342 | Last modified 10/26/2012 9:16 am by Jason Byrnes | 6576 views | 16 replies |

thehalpeen319342

Using Data Assist with Relational Databases

Dear Jason, can I use Data Assist, in a scenario where I have two tables.

I want to build a site that has a table called Household/Family. I have another table for Household/Family members.

I would like a Household/Family to register and add members in their household/family. The 'Household table' would have a column for household name, username and password. The other table, 'household/family members' table would have columns with first name, last name, phone, email, age.

Can Data Assist build an 'insert page' that will include fields from both tables on the insert page? I would then have a button on the insert page to 'add another member to this household' and you could continue adding to this household/family or I would ideally like to add multiple members at once. How do you get the fields from the various tables onto the one registration page/form?

I would also like to allow the Households/families who are registered to have the ability to add or delete members to their household. They should be able to 'add' at any time - as long as they are logged in - because they may want to add 'new arrivals' or delete members who have 'flown from the nest'

Sign in to reply to this post

sjones435326

The Data Assist Wizard will not automatically insert into 2 different table. However it can be done.

I just did this last week. Here is the thread that I used to get me started.

showthread.php?t=18115&highlight=insert+data+multiple+tables

Sign in to reply to this post

thehalpeen319342

Thanks for your reply - I'll see how I get on.

Sign in to reply to this post

thehalpeen319342

Okay, that works, and it's excellent. But can I use Data Assist to create the full CRUD?

Sign in to reply to this post

Jason ByrnesWebAssist

Not sure what you mean, the forum post in the link was about using Data Assist.

Please clarify.

Sign in to reply to this post

thehalpeen319342

Apoolgies - I meant to ask 'can you use the Data Assist Wizard' to create a set of pages (insert, delete, update, results and details) without having to do much hand coding? Is there a thread that shows this process with 2 or more tables - how do I display results, How to I delete from multiple tables?

Sign in to reply to this post

Jason ByrnesWebAssist

the wizard can only manage one table.

to manage more than one table on one set of pages, you need to manually add the additional form elements / server behaviors for the additional table, it cannot be accomplished using the wizard.

Sign in to reply to this post

thehalpeen319342

Okay. Alright, I know how to create the the various record sets and insert the Parent Id into the child table.

But in the directory I want to build, I need to have the facility to insert more than one record at a time into the child table - so you register your family/household in the Parent table called 'Household Table' and you add the first member of that family in the child table called 'Household Members' and your brought to a results page.

An option/link on the results page is to 'add another family member or click 'finish'. Is the Parent table ID session still available, to insert into the child table (2nd time round) when I add a second member or does it get destroyed when you submit it into the child table the first time. See next paragraph for what's happening to me.

I've created a page called 'Add_Another_Member.php', with only the filelds from the child table on this form for additional family members. I've added the Master_Id session variable in the Insert Record behaviour, but when I hit submit, I get an error saying 'Column 'master_id' cannot be null'

Another question - how do you display the result from multiple tables (Household Table and Household Members Table), onto a single page for the viewer to see in their browser?

Sign in to reply to this post

Jason ByrnesWebAssist

  when I add a second member or does it get destroyed when you submit it into the child table the first time.  




no, it should not get destroyed. send a copy of the parent insert and child insert pages so i can examine the code.


  Another question - how do you display the result from multiple tables (Household Table and Household Members Table), onto a single page for the viewer to see in their browser?  




this is very similar to showing orders and order details on a page. a good way to do this is by creating two separate results pages in Data Assist, one for the parent table and a second for the child table, then use plugins to display them both.

see the "Displaying Relational Tables with Plug-ins" tutorial on the Data Bridge support page for details:
data-bridge/

Sign in to reply to this post

thehalpeen319342

Jason, I have attached the file. The main php files are in a folder called 'Jason' inside the 'Jason Folder'. In the meantime I will checkout the tutorial on Data Bridge.

Attached Files
Jasonfolder.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...