Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

MSQL/ASP Problem.

Options
  • 21-03-2002 8:26pm
    #1
    Closed Accounts Posts: 2,682 ✭✭✭


    Just why does this asp script not write the data to the DB?

    The Submit form is here
    And the DB file is here

    Asp Code is below.
    <%

    'ConnectionString="DRIVER=org.gjt.mm.mysql.Driver;URL={jdbc:mysql://mysql.url.com/******};uid=******;pwd=******;"
    ConnectionString="DRIVER=org.gjt.mm.mysql.Driver;URL={jdbc:mysql://mysql.url.com/******};uid=******;pwd=******;"
    set con=server.createobject("adodb.connection")
    con.open(ConnectionString)
    set rs=server.createobject("adodb.recordset")
    dim rss
    set rss=server.createobject("adodb.recordset")
    dim k


    rss=con.execute("select max(scoutbid) as id from scoutb")
    k=rss("id")
    t1=k+1

    dim rs1,con
    set rs1=server.createobject("adodb.recordset")
    t2=Request.Form("t2")
    t3=Request.Form("t3")
    t4=Request.Form("t4")
    t5=Request.Form("t5")
    t6=Request.Form("t6")
    t7=Request.Form("t7")
    t8=Request.Form("t8")
    t9=Request.Form("t9")
    t10=Request.Form("t10")
    t11=Request.Form("t11")
    t12=Request.Form("t12")
    t13=Request.Form("t13")
    t14=Request.Form("t14")
    t15=Request.Form("t15")
    'response.write(t1&t2&t3&t4&t5&t6&t7&t8&t9&t10&t11&t12&t13&t14&t15)
    rs1=con.execute("insert into scoutb values("&t1&",'"&t2&"','"&t3&"','"&t4&"','"&t5&"','"&t6&"','"&t7&"','"&t8&"','"&t9&"','"&t10&"','"&t11&"','"&t12&"','"&t13&"','"&t14&"','"&t15&"')")

    response.write("Record Inserted Successfully")


    Hope you can help.


Comments

  • Registered Users Posts: 7,412 ✭✭✭jmcc


    Originally posted by chernobyl
    Just why does this asp script not write the data to the DB?

    rs1=con.execute("insert into scoutb
    values("&t1&",'"&t2&"','"&t3&"','"&t4&"','"&t5&"','"&t6&"','"&t7&"','"&t8&"','"&t9&"','"&t10&"','"&t11&"','"&t12&"','"&t13&"','"&t14&"','"&t15&"')")

    The MySQL the syntax for a multiple insert may be:

    INSERT INTO scoutb VALUES('t1'),('t2') etc.

    Also the VALUES list really should contain a value for each column and appear in the proper order alternatively you may have to specify it as:
    INSERT INTO scoutb(columnname) VALUES('t1'),('t2') ...

    It should be in the MySQL manual or FAQ. :)

    Regards...jmcc


  • Closed Accounts Posts: 2,682 ✭✭✭chernobyl


    Thankyou.


Advertisement