Online hours not saving previous record!

Results 1 to 3 of 3
  1. #1
    Valued Member Loki is offline
    MemberRank
    Jun 2012 Join Date
    138Posts

    Online hours not saving previous record!

    Hi every one.
    I really need help with WZ_DISCONNECT_MEMB.
    The online exchange hours that i made it's not save previous record it's always reset to 0 when logout and login , even getting DC in game the online hours won't save any thing at all.

    Code:
    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    go
    
    
    ALTER PROCEDURE [dbo].[WZ_DISCONNECT_MEMB]
    @memb___id varchar(10)
     AS
    Begin    
    set nocount on
        Declare  @find_id varchar(10)    
        Declare @ConnectStat tinyint
    	declare @OnlineHours int
        Set @ConnectStat = 0     
        Set @find_id = 'NOT'
        select @find_id = S.memb___id from MEMB_STAT S INNER JOIN MEMB_INFO I ON S.memb___id = I.memb___id 
               where I.memb___id = @memb___id
        if( @find_id <> 'NOT' )    
        begin        
            update MEMB_STAT set ConnectStat = @ConnectStat, DisConnectTM = getdate(), OnlineHours = (DATEDIFF(mi,ConnectTM,getdate()))
             where memb___id = @memb___id
        end
    end
    Thanks


  2. #2
    Enthusiast varcush is offline
    MemberRank
    Jun 2008 Join Date
    <?=$Romania;?>Location
    45Posts

    Re: Online hours not saving previous record!

    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    go


    ALTER PROCEDURE [dbo].[WZ_DISCONNECT_MEMB]
    @memb___id varchar(10)
    AS
    Begin
    set nocount on
    Declare @find_id varchar(10)
    Declare @ConnectStat tinyint
    declare @OnlineHours int
    Set @ConnectStat = 0
    Set @find_id = 'NOT'
    select @find_id = S.memb___id from MEMB_STAT S INNER JOIN MEMB_INFO I ON S.memb___id = I.memb___id
    where I.memb___id = @memb___id
    if( @find_id <> 'NOT' )
    begin
    update MEMB_STAT set ConnectStat = @ConnectStat, DisConnectTM = getdate(), OnlineHours = OnlineHours + (DATEDIFF(mi,ConnectTM,getdate()))
    where memb___id = @memb___id
    end
    end
    This should definetely work :D
    Last edited by varcush; 18-01-13 at 10:55 PM. Reason: forgot something

  3. #3
    Newbie daezugun is offline
    MemberRank
    Feb 2011 Join Date
    127.0.0.1Location
    787Posts

    Re: Online hours not saving previous record!

    Quote Originally Posted by varcush View Post
    This should definetely work :D
    it has a problem, it always says it already connected in game even you logged out. and you cant reset in website bcoz of that.



Advertisement