Monday, March 12, 2012

Login Error

Hi, I had a problem with the login function. The login function issupposed to authenicate the user email and password and if the both ofthem tally with each other, they can then be let into the other pages.But for my codes, the error is that even if the password and email doesnot tally, it can still procceed. Can someone pls help? Thanks! :)
ALTER PROCEDURE spLogin(@.MemEmail nvarchar(80), @.MemPwd VARCHAR(15))
AS
BEGIN
IF NOT EXISTS
(SELECT MemEmail
FROM DasMember
WHERE MemPwd = @.MemPwd)
RETURN -600
IF NOT EXISTS
(SELECT MemPwd
FROM DasMember
WHERE MemEmail = @.MemEmail)
RETURN -601
END
SELECT MemEmail, MemPwd
FROM DasMember
WHERE (MemPwd = @.MemPwd) and (MemEmail = @.MemEmail)
IF @.@.ERROR <> 0
RETURN @.@.ERROR
RETURN
DECLARE @.status int
EXEC @.status = spLogin 'jane@.yahoo.com.sg', 'jane'
SELECT 'Status' = @.status
It's alright. I found the error.. Thanks and sorry to trouble you guys..

No comments:

Post a Comment