close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

single & multiple record insert to parent/child tables

Thread began 7/13/2012 12:45 am by CraigR | Last modified 7/14/2012 8:58 am by CraigR | 6186 views | 4 replies

CraigRBeta Tester

single & multiple record insert to parent/child tables

Here’s my scenario, which must be fairly common...

I am creating a site with member access only, where members can have several contact email addresses.
So I added tables members (parent) and memberscontact (child) to my database, child table to store members email address, with fields, MembercontactID, MemberID (FK to members table) and EmailAddress.
What I want to do is add a single record insert behavior for all of the fields for the members table, and a multiple record insert behavior for the email details, using the same memberid as inserted into the members table. (memberID in member table is PK, auto increment).

When I have done something like this before, I always used a lookup query to check the maximum ID of the members (parent) table and inserted the next incremental value into my child table.
With Dataassist 2, I would create a single insert record behaviour first, then code the multi insert behavior according to the solution recipe.

My question is 2 fold.

1. what is the best approach for inserting child records by this method, I feel the lookup query method isn’t the best way. (eg i think ecart uses mysql_insert_id ?) and
2. do i need to lock tables / use transactions to ensure data integrity ?
Thanks

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