Help needed in inserting / updating tables withDreamweaver

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Help needed in inserting / updating tables withDreamweaver

    Hello. Just registered. I am building an OnLine CD-Shop for a class in college
    and I have some problems. I'll get right to the point:

    I am using Dreamweaver MX 2004 with SQL Server 2000 and ASP with VB Script

    I have problems in making Dreamweaver do multiple things. What I mean is:

    1) I have two tables: the customer_order table which stores data concerning
    the purchase minus the actual products (Table: customer_order - Collumns :
    order_id{PK}, customer_id, purchase_method_id, order_date) and the order_items
    table which stores the products that correspond to each purchase (Table:
    order_items - Columns: order_id{PK}, product_id{PK})

    2) What I want to do is for dreamweaver upon the submition of the checkout
    form which lists all the data mentioned above is to do two major things:
    a) Insert the relative data in the customer_order table once (I have done that)
    b) Insert the product_id data of the form in the order_items table with the
    same order_id that is used in the customer_order data. And on top of that it
    must insert the data multiple times, one time for each product in the checkout
    form. :D

    To give you an example:

    *****Form*****

    Customer Id = 1

    product_id = 1
    product_id = 2
    product_id = 3

    *****************

    When checkout is pressed by the user this is what I want to happen to the
    tables (assume the table where empty before)

    customer_order
    order_id = 1 (it is handled automatically by the database)
    customer_id = 1
    ...

    order_items
    order_id = 1 | 1 | 1
    product_id = 1 | 2 | 3

    And I want all this things to happen simultaneously.

    Now I haven't figured out two things: The first one being how can Dreamwever
    insert data into multiple tables (two in this specific example) and second, and
    probably more importatnt, how can Dreamweaver insert multiple rows of data into
    a single table.

    I have some programming experience and for the latter case I assume I could
    use some kind of 'for' loop where it counts the number of products and then it
    somehow repeats the insert process for the count of the number of products...
    But I cannot figure how to do that with the Dreamweaver generated code.

    Anyway I would really appreciate some help because this is my greatest (and
    probably last) problem with this project and the deadline is in 1 1/2 weeks.

    Thank you in advance.

    NoQuarter Guest

  2. Similar Questions and Discussions

    1. Having trouble inserting/updating, please look @ code
      Hello, I'm getting an error while trying to insert a record from a form, or update a record from the datagrid. ERROR: at...
    2. Problem inserting/updating records
      Hi I'm having trouble trying to insert/update the records in SQL Server. I have created a form based on two tables and created a select...
    3. Updating and Inserting simoultaneously
      hello not sure if this is possible, i need to update a field in a table and then insert a new record into a different table from when the user...
    4. Updating/inserting >> Linking table
      A dilemma: If I am attempting to add multiple products to an existing Customer-Products linking table do I do this via an Insert or Update? ...
    5. Much needed help with updating tables
      I have two tables. One is a static table where I have one field that is used as a combo box field in a form. I am trying to update the second...
  3. #2

    Default Re: Help needed in inserting / updating tables with Dreamweaver

    There is a tutorial on [url]www.charon.co.uk[/url] on how to do an insert into multiple
    tables.

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

    "NoQuarter" <webforumsuser@macromedia.com> wrote in message
    news:d61kqk$km0$1@forums.macromedia.com...
    > Hello. Just registered. I am building an OnLine CD-Shop for a class in
    college
    > and I have some problems. I'll get right to the point:
    >
    > I am using Dreamweaver MX 2004 with SQL Server 2000 and ASP with VB
    Script
    >
    > I have problems in making Dreamweaver do multiple things. What I mean is:
    >
    > 1) I have two tables: the customer_order table which stores data
    concerning
    > the purchase minus the actual products (Table: customer_order - Collumns :
    > order_id{PK}, customer_id, purchase_method_id, order_date) and the
    order_items
    > table which stores the products that correspond to each purchase (Table:
    > order_items - Columns: order_id{PK}, product_id{PK})
    >
    > 2) What I want to do is for dreamweaver upon the submition of the
    checkout
    > form which lists all the data mentioned above is to do two major things:
    > a) Insert the relative data in the customer_order table once (I have done
    that)
    > b) Insert the product_id data of the form in the order_items table with
    the
    > same order_id that is used in the customer_order data. And on top of that
    it
    > must insert the data multiple times, one time for each product in the
    checkout
    > form. :D
    >
    > To give you an example:
    >
    > *****Form*****
    >
    > Customer Id = 1
    >
    > product_id = 1
    > product_id = 2
    > product_id = 3
    >
    > *****************
    >
    > When checkout is pressed by the user this is what I want to happen to the
    > tables (assume the table where empty before)
    >
    > customer_order
    > order_id = 1 (it is handled automatically by the database)
    > customer_id = 1
    > ...
    >
    > order_items
    > order_id = 1 | 1 | 1
    > product_id = 1 | 2 | 3
    >
    > And I want all this things to happen simultaneously.
    >
    > Now I haven't figured out two things: The first one being how can
    Dreamwever
    > insert data into multiple tables (two in this specific example) and
    second, and
    > probably more importatnt, how can Dreamweaver insert multiple rows of data
    into
    > a single table.
    >
    > I have some programming experience and for the latter case I assume I
    could
    > use some kind of 'for' loop where it counts the number of products and
    then it
    > somehow repeats the insert process for the count of the number of
    products...
    > But I cannot figure how to do that with the Dreamweaver generated code.
    >
    > Anyway I would really appreciate some help because this is my greatest
    (and
    > probably last) problem with this project and the deadline is in 1 1/2
    weeks.
    >
    > Thank you in advance.
    >

    Paul Whitham TMM 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