Professional Web Applications Themes

Using INSERT with Multiple Tables - Dreamweaver AppDev

After seeing different tutorials I have reached the conclution to hand code the insert page on my site since it has to update mutliple tables something that is hard to do with a server behaviour. I have a main table with data in it called tbMembers containing heaps of personal data. I have a second table called tbMembertra containing other member relevant data. tbMembers has a primary key called SysMemId tbMembertra has a primary Key called MemExtraID and foreign key called SysMemId. The data i want to insert is stored in session variables and NOT a form. Some data belongs ...

  1. #1

    Default Using INSERT with Multiple Tables

    After seeing different tutorials I have reached the conclution to hand code
    the insert page on my site since it has to update mutliple tables something
    that is hard to do with a server behaviour.

    I have a main table with data in it called tbMembers containing heaps of
    personal data.
    I have a second table called tbMembertra containing other member relevant
    data.

    tbMembers has a primary key called SysMemId
    tbMembertra has a primary Key called MemExtraID and foreign key called
    SysMemId.

    The data i want to insert is stored in session variables and NOT a form.

    Some data belongs in one table the rest in the other.

    Do i really have to have separate SQL insert statements to cater for this or
    can it be done using one SQL insert statement. I obviously want to store the
    relevant data without losing the relationship.

    Can someone put me on the right track for doing INSERTS as mentioned above
    into different tables?

    Thanks.



    Tim Mannah Guest

  2. #2

    Default Re: Using INSERT with Multiple Tables

    You have to construct an insert statement for each table. The exact code
    will depend upon the server language being used

    --
    Regards

    Paul Whitham
    Macromedia Certified Professional for Dreamweaver MX2004
    Valleybiz Internet Design
    [url]www.valleybiz.net[/url]

    Team Macromedia Volunteer for Ultradev/Dreamweaver MX
    [url]www.macromedia.com/support/forums/team_macromedia[/url]

    "Tim Mannah" <timmdiabetesnsw.com.au> wrote in message
    news:d5rljp$i72$1forums.macromedia.com...
    > After seeing different tutorials I have reached the conclution to hand
    code
    > the insert page on my site since it has to update mutliple tables
    something
    > that is hard to do with a server behaviour.
    >
    > I have a main table with data in it called tbMembers containing heaps of
    > personal data.
    > I have a second table called tbMembertra containing other member
    relevant
    > data.
    >
    > tbMembers has a primary key called SysMemId
    > tbMembertra has a primary Key called MemExtraID and foreign key called
    > SysMemId.
    >
    > The data i want to insert is stored in session variables and NOT a form.
    >
    > Some data belongs in one table the rest in the other.
    >
    > Do i really have to have separate SQL insert statements to cater for this
    or
    > can it be done using one SQL insert statement. I obviously want to store
    the
    > relevant data without losing the relationship.
    >
    > Can someone put me on the right track for doing INSERTS as mentioned above
    > into different tables?
    >
    > Thanks.
    >
    >
    >

    Paul Whitham TMM Guest

  3. #3

    Default Re: Using INSERT with Multiple Tables

    Hi,
    We have included this functionality in MX Kollection 3 - that is in
    beta right now. So - it's possible with server behaviors.

    If you want to take part in the beta - just contact me at
    [email]acostininteraktonline.com[/email] and I will register you in about one week.

    Alexandru

    Tim Mannah wrote:
    > After seeing different tutorials I have reached the conclution to hand code
    > the insert page on my site since it has to update mutliple tables something
    > that is hard to do with a server behaviour.
    >
    > I have a main table with data in it called tbMembers containing heaps of
    > personal data.
    > I have a second table called tbMembertra containing other member relevant
    > data.
    >
    > tbMembers has a primary key called SysMemId
    > tbMembertra has a primary Key called MemExtraID and foreign key called
    > SysMemId.
    >
    > The data i want to insert is stored in session variables and NOT a form.
    >
    > Some data belongs in one table the rest in the other.
    >
    > Do i really have to have separate SQL insert statements to cater for this or
    > can it be done using one SQL insert statement. I obviously want to store the
    > relevant data without losing the relationship.
    >
    > Can someone put me on the right track for doing INSERTS as mentioned above
    > into different tables?
    >
    > Thanks.
    >
    >
    >
    --
    InterAKT Online - Dreamweaver extensions
    [url]http://www.interaktonline.com/[/url]
    Alexandru COSTIN Guest

  4. #4

    Default Re: Using INSERT with Multiple Tables

    I've an article on the subject that may be useful

    [url]http://www.charon.co.uk/content.aspx?CategoryID=27&ArticleID=47[/url]

    --
    Jules
    [url]http://www.charon.co.uk/charoncart[/url]
    Charon Cart 3
    Shopping Cart Extension for Dreamweaver MX/MX 2004


    Julian Roberts Guest

  5. #5

    Default Re: Using INSERT with Multiple Tables

    I recommend using the Insert Behavior, then passing all the form values in a
    session variable to a second page.
    Then on the second page populate hidden form fields with the session
    variables. Use the same insert behavior for the 2nd table you want to insert
    to.

    Here?s the page to explain the set up to pass the session variable:
    [url]http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_16516[/url]

    Here?s what you need to auto submit the form.
    <body onLoad="doent.forms[0].submit()">

    Glitch808 Guest

Similar Threads

  1. insert form data into joined tables...
    By createmedia in forum Coldfusion Database Access
    Replies: 2
    Last Post: January 24th, 09:10 PM
  2. Multiple Insert or Looping Insert
    By payado in forum Dreamweaver AppDev
    Replies: 1
    Last Post: May 25th, 09:33 PM
  3. Insert into two tables from a single submit
    By Murray *TMM* in forum Dreamweaver AppDev
    Replies: 5
    Last Post: May 17th, 05:49 PM
  4. update multiple records in multiple tables from one form
    By Anj01 in forum Coldfusion Database Access
    Replies: 1
    Last Post: May 17th, 05:54 AM
  5. insert data for two tables at same time?
    By stieffy in forum Macromedia ColdFusion
    Replies: 6
    Last Post: February 22nd, 10:24 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139