inserting multiple row into my mysql with on insert statement

Discussion in 'Programming' started by shaun112, Jul 20, 2008.

  1. #1
    i want to insert mutiple rolls into mysql.
    the number of values that will be inserted is unknown becuase it is generated from a database.
    example
    EG67676
    DEHYHG
    REHYTTT
    JHYYYY
    all this values have a check box infront of them,and i want the user to be able to check which value they want to insert
    pleas i am srill very mush beging in coldfusion so pleas be very comprehensive. thanks in advance
     
    shaun112, Jul 20, 2008 IP
  2. CR250

    CR250 Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Show us what you have so far so we know what to work with.
     
    CR250, Jul 20, 2008 IP
  3. phydiux

    phydiux Peon

    Messages:
    17
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Well, it doesn't sound like you need to insert multiple rows with one query - you just need to loop and insert multiple rows in your processing page.

    cfloop through your original query, checking for the query result value against the form structure - if they match, then insert a "roll" record into your database using cfquery.

    ----

    If you actually wanted to perform multiple queries in one cfquery block, you can doing the following:
    -In your CF administrator, append "?allowMultiQueries=true" to the end of your mysql jdbc url
    -use a semicolon to separate your queries in one cfquery block.
     
    phydiux, Jul 23, 2008 IP