Log in

Please declare the exact username and password!

Forgot password?

Đăng Ký

Bạn phải điền đầy đủ thông tin đăng ký!

  

    [Share] Query Pk Count

      Administrators
      ๖ۣۜAdministrators

      Posts Posts : 650

      Points Points : 63354

      Thanks Thanks : 758

      Gender Gender : Male

      JoinDate JoinDate : 2010-11-25

      #1

       Thu Jul 25, 2013 10:04 pm

      Add column in RanGame1 >Chainfo

      Column name "ChaKill" bigint not null

      then execute this on ranlog

      Code:
      set ANSI_NULLS ON
      set QUOTED_IDENTIFIER ON
      GO



      ALTER PROCEDURE [dbo].[sp_LogAction_Insert]
          @nChaNum int,
          @nType int,
          @nTargetNum int,
          @nTargetType int,
          @nExpPoint money,
          @nBrightPoint int,
          @nLifePoint int,
          @nMoney money
      AS   
          SET NOCOUNT ON
      IF (@nType=2)
          BEGIN
          Update RanGame1.dbo.ChaInfo
          Set ChaKill=ChaKill+1
          Where ChaNum=@nChaNum
          END

          INSERT INTO LogAction (ChaNum,  Type,  TargetNum,  TargetType,  ExpPoint,  BrightPoint,  LifePoint,  ActionMoney)
          VALUES    (@nChaNum, @nType, @nTargetNum, @nTargetType, @nExpPoint, @nBrightPoint, @nLifePoint, @nMoney)

          SET NOCOUNT OFF

      then create your custom ranking php script which will count values in chakill column