Problem displaying User Status from SQL
Hello all,
I am using the following stored procedure to recoed the online and offline status of user
CREATE PROCEDURE sproc_onlinemembers
@UID varchar(15)
AS
BEGIN
SET NOCOUNT ON
DECLARE @Username char(16)
SELECT @Username=Username FROM UserLogin WHERE UserID=@UID
UPDATE UserInfo
SET Status='1', statustime=getdate(), lastlogin=getdate()
WHERE Username=@Username
UPDATE UserInfo
SET Status='0'
WHERE datediff(n,statustime,getdate()) > 30 OR StatusTime=NULL
END
GO
Now I am trying to use it in my asp page so that I can show that whether the user is offline or online but it is even showing users online who have logged out before 30 minutes. Here is how I am displaying it in one page
************************************************** ******
<%
IF ORs("Status")=TRUE THEN
Response.Write "<img src='/new/images/online.gif' width='25' height='122'>"
ELSE
Response.Write "<img src='/new/images/offline.gif' width='25' height='122'>"
END IF
%>
***************************************
Now this was working fine and then I had to switch to another hard drive and I mirrored everything onto this hard drive. Since then I am having this problem. Please suggest
Thank you,
Palwinder
|