Need help with syntax of requesting data from database

Discussion in 'MySQL' started by Nagglfar, Nov 30, 2008.

  1. #1
    I keep getting a vb "compilation error" probably because my syntax in my code is wrong. I'm trying to compare values from a db to what is entered in a textbox. From there, I want to redirect the user based on their userid..

    This is what I have so far:
    --------------------------------------
    If username = "john" Then
    “Select * From users Where acc_id = ‘“ & Request(“usernamebox textbox”) & “’”
    Response.redirect "home.asp"

    Elseif username = "ben" Then
    “Select * From users Where acc_id = ‘“ & Request(“usernamebox textbox”) & “’”
    Response.redirect "home2.asp"

    'If Account Doesn't Exist
    Else
    Response.write "Account does not exist."
    End If
    --------------------------------------


    is my sql statement wrong? I'm not quite sure how to set it up. I have made the dsn and opened up the connections and recordset.
     
    Nagglfar, Nov 30, 2008 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    What does the compilation error say?

    I am not familiar with VB, can you point out where you are connecting to the database and sending a mysql query?
     
    mwasif, Dec 1, 2008 IP