Querry N°1
Código PHP:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MEMB_STAT_GJ]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)drop table [dbo].[MEMB_STAT_GJ]GO
CREATE TABLE [dbo].[MEMB_STAT_GJ] (
[memb___id] [char] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[name] [char] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[ServerName] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[ServerCode] [int] NULL ,
[IP] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[TM] [datetime] NULL) ON [PRIMARY]
Código PHP:
use MuOnlineif exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[WZ_CONNECT_MEMB]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)drop procedure [dbo].[WZ_CONNECT_MEMB]GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE WZ_CONNECT_MEMB@uid varchar(10),
@server varchar(20),
@uip varchar(20)
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
EndELSEBegin
INSERT INTO MEMB_STAT ( memb___id,ip,connectstat,servername)valueS (@uid,@uip,1,@server )EndIF(@@Error <> 0 )ROLLBACK TRANSACTIONELSECOMMIT TRANSACTION
--??????
IF EXISTS ( SELECT UserID FROM UserLogin WITH (READUNCOMMITTED) WHERE UserID = @uid )Begin
UPDATE UserLogin
SET LoginIP=@uip,Server=@server,LoginTM = (getdate()),OnlineSec=0,GiveMoney=0,logoutTM=null
WHERE UserID = @uid
EndELSEBegin
INSERT INTO UserLogin (UserID,LoginIP,Server,LoginTM,OnlineSec,GiveMoney )values (@uid,@uip,@server,getdate(),0,0)End--?????????????
declare @SmallestZS intdeclare @LargestZS intdeclare @Type int
select @Type=Type from SetServerList where ServerName=@server
if (@Type>0) begin
select @SmallestZS=Smallest_ZS from SetServerList where ServerName=@server
select @LargestZS=Largest_ZS from SetServerList where ServerName=@server
if not (@SmallestZS is null) begin
update character set ctlcode=(ctlcode | 0x81) where [name] not in(SELECT NAME FROM WEB_ZS WHERE (ACC = @uid) AND (ZSCS >= @LargestZS) AND (ZSCS <= @SmallestZS)
) AND (AccountID = @uid)end
end
DELETE FROM MEMB_STAT_GJ WHERE (memb___id = @uid and servername=@server)update character set ctlcode=(ctlcode | 0x81) where [name] in(SELECT name FROM MEMB_STAT_GJ WHERE (memb___id = @uid)
) AND (AccountID = @uid)
SET NOCOUNT OFF
End
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
PD no olviden qe antes de qe nada deben tener el server OFF y hacer un respaldo o copia cmo qieran dcirle a la base de datos "MuOnline"
PD2: Lo prometido es Deuda, agradecer no cuesta nada saludos..