Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 2nd, 2005, 03:40 PM
Authorized User
 
Join Date: Jun 2005
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating user status with checkbox arnabghosh Pro PHP 1 February 12th, 2006 06:02 PM
Displaying user image from sql database palvin Classic ASP Databases 14 July 6th, 2005 05:09 AM
Displaying Status in steps sankar Classic ASP Basics 1 April 27th, 2004 03:36 AM
Displaying Url from database in Status Bar ntriqetev Classic ASP Basics 1 December 17th, 2003 09:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.