Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2009

    Unanswered: Insert multiple form data to DB


    I have a form that uses arrays to collect data:

    <input type="hidden" name="User_id">
    <input type="text" name="ProductCode[]">
    <input type="text" name="ProductCodeQuantity[]">
    Each user can choose varios PRODUCTS and choose how many products he wants. (ex. car (6), tire(2)...etc)

    Is there a way to insert an ORDER to my DB with the clients's ID and the ORDER ID and in the products column ALL the array

    Client_id ->0001 Order_id ->12345 products -> car-6 , tire-2...etc

    It has to be some sort of a loop as the client can choose as many products and quantity he wants

    Hope some one can help.

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    This insnt really a MySQL question, its to do with the language your form handler is written in

    yes you will have to iterate through your array and insert the order details
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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