GamesDrobeta

Doriți să reacționați la acest mesaj? Creați un cont în câteva clickuri sau conectați-vă pentru a continua.

GamesDrobeta


    Cum Fixezi Account Aleardy Connected Bug

    FuNky
    FuNky
    Administrator
    Administrator


    Mesaje : 116
    Data de inscriere : 06/03/2010
    Varsta : 32
    Localizare : Drobeta Turnu Severin

    Cum Fixezi Account Aleardy Connected Bug Empty Cum Fixezi Account Aleardy Connected Bug

    Mesaj  FuNky Joi Mar 11, 2010 6:00 am

    Cum fixezi "Account Aleardy Connected" bug?
    Simplu... ruleaza urmatoarele 2 Scripturi in SQL Query analyzer.

    Cod:
    CREATE PROCEDURE WZ_CONNECT_MEMB

    @uid varchar(10),
    @server varchar(15),
    @uip varchar(15)
    AS

    Begin

    BEGIN TRANSACTION

    SET NOCOUNT ON

    IF EXISTS ( SELECT memb___id FROM MEMB_STAT WITH (READUNCOMMITTED)
    WHERE memb___id = @uid )

    Begin
    UPDATE MEMB_STAT
    SET IP = @uip , ConnectStat = '1' , ServerName = @server , ConnectTM = (getdate())
    WHERE memb___id = @uid
    End
    ELSE
    Begin
    INSERT INTO MEMB_STAT ( memb___id,ConnectStat,ServerName,IP,  ConnectTM) values (
    @uid,
    '1',
    @server,
    @uip,
    (getdate())
    )
    End

    IF(@@Error <> 0 )
    ROLLBACK TRANSACTION
    ELSE
    COMMIT TRANSACTION

    SET NOCOUNT OFF
    End
    GO

    si acest Script

    Cod:
    CREATE PROCEDURE WZ_DISCONNECT_MEMB

    @uid varchar(10)
    AS
    Begin

    BEGIN TRANSACTION

    SET NOCOUNT ON

    IF EXISTS ( SELECT memb___id FROM MEMB_STAT WITH (READUNCOMMITTED)
    WHERE memb___id = @uid )

    Begin
    UPDATE MEMB_STAT
    SET DisConnectTM = (getdate()), connectstat = '0'  WHERE memb___id = @uid
    End
    ELSE
    Begin
    INSERT INTO MEMB_STAT ( memb___id,ConnectStat,DisConnectTM) values (
    @uid,
    0,
    (getdate())
    )
    End


    IF(@@Error <> 0 )
    ROLLBACK TRANSACTION
    ELSE
    COMMIT TRANSACTION

    SET NOCOUNT OFF
    End
    GO

    Daca ati rulat aceste doua scripturi trebe sa va mearga perfect! :^_^:

      Data/ora curentă este: Mier Noi 13, 2024 11:48 pm