insert form data into joined tables...

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default insert form data into joined tables...

    Hello All,

    I am trying to insert form data in to two joined tables. If Table 1 has a
    "ProductID" unique key and Table 2 has a numeric "ProductID" field..... (the
    joined field) ....how can I insert a form submission into the 2 tables..?

    Thanks so much for any help you can give...... I'm starting to drink heavily
    on this one :-)
    So far, this is the basic structure.... but obviously does not work for the
    joined tables ...

    THANKS!!!

    <CFQUERY name="Testing" datasource=" ">
    INSERT INTO Table1(data,data1)
    VALUES ('#form.data#','#form.data1#')
    </CFQUERY>

    <CFQUERY name="Testing2" datasource=" ">
    INSERT INTO Table2(data,data1)
    VALUES ('#form.data2#','#form.data3#')
    </CFQUERY>

    createmedia Guest

  2. Similar Questions and Discussions

    1. insert data in 2 differents tables in same cfquery
      Hi! I have problem with a special odbc driver that only permit me to insert data if insert data in table1 and after in table2.... Something like:...
    2. how to update joined tables?
      I have this query: SELECT PlanDB.RecNum, PlanDB.ClientId, PlanDB.AdminId, PlanDB.PlanCodeId, PlanDB.PlanNum, PlanDB.PlanName, PlanDB.PlanYearEnd,...
    3. Can one <form> submit data to multiple tables?
      Am I able to use a single form to write data to multiple tables in my database using php/mySQL?
    4. insert data for two tables at same time?
      1 to many relationship tables first table - project number (auto), project name, Proj manager, proj date, proj description second table - project...
    5. Login - multi table insert for registrant; subsquent login insert page requests into joined 'Selection' Table
      Question regards insert and updates in sql server for a simple login script that requires registration the first time and only "email address" upon...
  3. #2

    Default Re: insert form data into joined tables...

    You need to get the new productid from the first table. There are lots of ways to do this. What db are you using?
    Dan Bracuk Guest

  4. #3

    Default Re: insert form data into joined tables...

    I'm using MS Access on the server...
    thanks...
    createmedia Guest

Posting Permissions

  • You may not post new threads
  • You may 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