Sign-up

Discussion in 'ASP General' started by Athmaus, Jun 23, 2004.

  1. Athmaus

    Athmaus Guest

    Hey!

    I am creating a little signup script and tus far i have run into problems with this line. This line inserts the users information that they entered from the form into the SQL database. Does anyone know what is wrong with this line?

    myconn.execute("INSERT regfreeup set signup = '" & Now() & "' , firstname = '" & first & "' , lastname = '" & last & "' , email = '" & email & "' , ordernum = '" & order & "', username = '" & user & "' , pass = '" & pass & "' , site = '" & site & "';")

    Thanks!!
     
    Athmaus, Jun 23, 2004
    #1
    1. Advertising

  2. try this;

    <%
    myconn.execute("INSERT INTO regfreeup
    (signup,firstname,lastname,email,ordernum,username,pass,site) VALUES (" &
    Now() & "','" & first & "','" & last & "','" & email & "','" & order & "','"
    & user & "','" & pass & "','" & site & "'")
    %>

    this will still throw an error if your 'signup' field is of type 'date/time'
    or your 'ordernum' field is of type 'number'

    hope this helps

    "Athmaus" <> wrote in message
    news:...
    > Hey!
    >
    > I am creating a little signup script and tus far i have run into problems

    with this line. This line inserts the users information that they entered
    from the form into the SQL database. Does anyone know what is wrong with
    this line?
    >
    > myconn.execute("INSERT regfreeup set signup = '" & Now() & "' , firstname

    = '" & first & "' , lastname = '" & last & "' , email = '" & email & "' ,
    ordernum = '" & order & "', username = '" & user & "' , pass = '" & pass &
    "' , site = '" & site & "';")
    >
    > Thanks!!
     
    [ + 2 0 r p 3 ], Jun 23, 2004
    #2
    1. Advertising

  3. Athmaus

    David Berry Guest

    You're using update syntax for an insert statement. For Insert you want:

    INSERT INTO Table (Values)

    For UPDATE you'd use

    UPDATE table SET Field1 = value, Field2 = value ...etc


    "Athmaus" <> wrote in message
    news:...
    > Hey!
    >
    > I am creating a little signup script and tus far i have run into problems

    with this line. This line inserts the users information that they entered
    from the form into the SQL database. Does anyone know what is wrong with
    this line?
    >
    > myconn.execute("INSERT regfreeup set signup = '" & Now() & "' , firstname

    = '" & first & "' , lastname = '" & last & "' , email = '" & email & "' ,
    ordernum = '" & order & "', username = '" & user & "' , pass = '" & pass &
    "' , site = '" & site & "';")
    >
    > Thanks!!
     
    David Berry, Jun 23, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. susan

    .net sign in passport

    susan, May 5, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    459
    William Ryan eMVP
    May 6, 2004
  2. andy
    Replies:
    2
    Views:
    3,270
    mike_treseler
    Nov 16, 2004
  3. Dave Bazell

    BigInt leading plus sign

    Dave Bazell, Dec 13, 2005, in forum: Perl
    Replies:
    2
    Views:
    2,640
    Dave Bazell
    Dec 14, 2005
  4. Jimmy
    Replies:
    1
    Views:
    986
    Cowboy \(Gregory A. Beamer\)
    Nov 21, 2006
  5. Jimmy
    Replies:
    3
    Views:
    2,452
    shimmyshack
    Nov 20, 2006
Loading...

Share This Page