close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Insert multiple record in two tables

Thread began 6/24/2009 2:41 pm by info321189 | Last modified 6/26/2009 12:44 pm by info321189 | 1794 views | 6 replies |

info321189

Insert multiple record in two tables

Hi, I need to create an image gallery, the first table contain the gallery name, date created and the thumb pic, the second table contain the picture, the name and description.
I add the gallery ID field in the pics table.
I need to build a insert page with gallery name, date created and multiple insert record for pics.
I already try to do this with manage relational table but I get the error :" Column 'IDgallery' cannot be null ".
Before using DataAssist I do this by creating a page for assign the IDgallery and another page to update the table in relation.... :-s

Sign in to reply to this post

Ray BorduinWebAssist

You should do it the same way now... two separate pages.

Sign in to reply to this post

info321189

Hello Ray, thankyou for the fast reply, I can use manage relational table if I not insert multiple records in the details relation ?
I see a lot of gallery with mootools-slide like effect, all galleries require the galleryname ( and set with this the galleryID I think ) at the end of setup, after load on the server all pics and descriptions... the only way to do this is passing a lot of session variables ?
I can do this with WADA insert multiple records server behaviors ?

Thankyou again.

Sign in to reply to this post

Ray BorduinWebAssist

I would need to really understand your database and form design to be sure what is or isn't possible with each tool.

Multiple Insert will do an insert statement for multiple rows as displayed using the "repeat selection" server behavior

Multiple Updeate will execute an update for multiple rows displayed with a "repeat selection" server behavior from dataassist.

Manage relational table will delete records based on a key (ParentID) and insert multiple records based on a multiselect list or group of radio buttons. The effect is similar to an update but is actually achieved through a delete and insert. This is good for managing related tables in a three table database structure when fields from the first child already exist and you are inserting or updating the parent record.

Depending on your workflow, database structure, and what pages you use for what functionality it could be done a number of ways.

Sign in to reply to this post

info321189

Hello Ray, this is a picture that show the relation in my database, I use MySQL database (MyISAM).


My goal is an insert page with multiple images fields and gallery name.
I see some dynamic galleries on the web that do this.
The right way is create an insert record link and point to a page for create the IDgallery and a default gallery_name and redirect to another page with update record ?

Thankyou for your patience

Sign in to reply to this post

Ray BorduinWebAssist

Since there are only tow tables you wouldn't use manage relational table.

You could probably use the Insert server behavior on multiple pages, or really run DataAssist two times and link the groups of pages for full management of a two table relationship.

An example is what you see in the powerstore order information. It uses the orders and orderdetails tables and provides back-end read access and order update. You could imagine a similar implementation with edit access to the individual child records as well in that framework.

The reality is that it takes several pages to allow someone to find, insert, update records from both tables. You can do it all with just single inserts at a time, you just want to maintain a relationship but that doesn't necessarily mean even using multiple insert although you could design a user interface to do that.

Your database design is too simple to take advantage of manage relational tables, so you can ignore that. From there what you use depends on what user interface you decide you want.

Sign in to reply to this post

info321189

Hello Ray and thankyou again for your patience.
I can found any sample or tutorial how can work the 'manage relational table' server behavior ?

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