|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
What is wrong with this SQL syntax?? (USING ASP)
Hello,
I have a page that checks for username and password and redirects ueser to the appropriate page... Could someone tell me what is wrong with my SQL syntax Code:
Sub something()
a = request.form("Emp_Id")
b = request.form("Emp_Pass")
[MYSQL]SQL = "SELECT * from Authentication WHERE [Emp_Id] = '"& a &"' AND WHERE [Emp_Pass] = '"& b &"'"[/MYSQL]
set rs = conn.execute(SQL)
If rs.EOF Then
Session("Authenticated") = 0
Response.Redirect ("default.asp")
Else
Session("Authenticated") = 1
Response.Redirect ("pick.asp")
End If
End Sub
The error i get in the explorer is Quote:
Any help is appreciated. Faheem. a.faheem@gmail.com |
|
#2
|
||||
|
||||
|
try this:
Code:
SQL = "SELECT * from Authentication WHERE [Emp_Id] = '"& a &"' AND [Emp_Pass] = '"& b &"'" you don't use a second where statement, you just seperate them with AND or OR
__________________
Come JOIN the party!!! Quote of the Month: Retirement: Because you've given so much of yourself to the company that you don't have anything left we can use. Questions to Ponder: What do you do when you see an endangered animal eating an endangered plant? iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm") copyright© 2008 sbenj69 |
![]() |
| Viewing: ASP Free Forums > Other > Programming Help > What is wrong with this SQL syntax?? (USING ASP) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|