Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2003
    Posts
    59
    Provided Answers: 1

    Question Unanswered: WHERE AND Clause in mySQL string

    Hey all i am having trouble figuring out why this code does not seem to work:
    Code:
    Set oConnection = Server.CreateObject("ADODB.Connection")
    Set oRecordset = Server.CreateObject("ADODB.Recordset")
    
    oConnection.Open "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=thesite.com; PORT=3306; DATABASE=dbname; USER=myuser; PASSWORD=thepass; OPTION=3;"	
    	sqltemp="select * from fbusers where Email = '" & myEmail & " AND Company = " & myStore & "'"
    		
    	oRecordset.Open sqltemp, oConnection,3,3
    	set rstemp = oRecordset
    
             If rstemp.eof then
    		rstemp.close
    		oConnection.close
    		set rstemp = nothing
    		set oConnection = nothing
    		
    		response.write myEmail & vbcr & myPass & vbcr & myStore & vbcr & "NO"
    	else
    		oRecordset.Close
    		Set oRecordset = Nothing
    		oConnection.close
    		set oConnection = nothing
    		
    		response.write myEmail & vbcr & myPass & vbcr & myStore & vbcr & "YES"
    	end if
    I'm showing the values for the myEmail, myPass and myStore just fine... however i think its my query that's all screwed up....
    Code:
    sqltemp="select * from fbusers where Email = '" & myEmail & " AND Company = " & myStore & "'"
    Any help would be great!

    David

  2. #2
    Join Date
    Jul 2003
    Posts
    59
    Provided Answers: 1
    Solved:
    Code:
    sqltemp="select * from fbusers where Email = '" & myEmail & "' AND Company = '" & myStore & "'"
    David

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •