Insert data into two table

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • jhardman
    replied
    You need to post db questions in the appropriate db forum. PLEASE STOP POSTING YOUR DB QUESTIONS IN THE ASP FORUM.

    Jared

    Leave a comment:


  • GazMathias
    replied
    sql2 has a missing opening parenthesis so would produce "values'shivans usan'" instead of "values ('shivansusan'"

    A simple SQL sensibility check would have saved you here:

    Code:
    response.write sql2
    response.end
    my_conn.execute(sql2)
    Gaz

    Leave a comment:


  • shivasusan
    started a topic Insert data into two table

    Insert data into two table

    Hi!

    I have two tables in my database (userinfo, logininfo)

    - userinfo table has five fields (uname, pws, con_pws, squest, sans)
    - logininfo table has then six fields (fname,lname,do b,add1, add2, country)

    I want to insert data in two tables (userinfo, logininfo) using this code:
    Code:
    <%sql1="insert into userinfo (uname, pws, con_pws, squest, sans) values ('"&uname&"','"&pws&"','"&con_pws&"','"&squest&"','"&sans&"');"
    my_conn.execute(sql)
    
    sql2="insert into logininfo(fname,lname,dob,add1, add2, country) values'"&fname&"','"&lname&"','"&dob&"','"&add1&"','"&add2&"','"&country&"')"
    my_conn.execute(sql2)
    %>
    error - syntax error in INSERT INTO


    how i slow this problem........ .... ?

    pls help me.... and give idea.

    thanks,
    susan
Working...