Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

MSQL/ASP Problem.

  • 21-03-2002 08: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, Registered Users 2 Posts: 7,802 ✭✭✭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

    Regards…jmcc



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


    Thankyou.


Advertisement