Admin Panel Issue

12/03/2012 00:31 diehard6#1
I get an error when trying to access the online users.

Warning: mssql_query() [function.mssql-query]: message: Invalid column name 'LoginStatus'. (severity 16) in C:\Program Files (x86)\xampp\htdocs\AdminPanel\Player_login_status. php on line 8

Warning: mssql_query() [function.mssql-query]: Query failed in C:\Program Files (x86)\xampp\htdocs\AdminPanel\Player_login_status. php on line 8
IF ANY PLAYER IS FOUND INSIDE OF MAP 71 or 72 WHEN MAPS ARE CLOSED LOG IN AND ATEMPT TO /amove TO THEM IF IT DOSENOT LET YOU THEN SUMMON THEM OUT

Warning: mssql_num_rows(): supplied argument is not a valid MS SQL-result resource in C:\Program Files (x86)\xampp\htdocs\AdminPanel\Player_login_status. php on line 24
players online:
Warning: mssql_query() [function.mssql-query]: message: Invalid column name 'LoginStatus'. (severity 16) in C:\Program Files (x86)\xampp\htdocs\AdminPanel\Player_login_status. php on line 35

Warning: mssql_query() [function.mssql-query]: Query failed in C:\Program Files (x86)\xampp\htdocs\AdminPanel\Player_login_status. php on line 35

Warning: mssql_fetch_assoc(): supplied argument is not a valid MS SQL-result resource in C:\Program Files (x86)\xampp\htdocs\AdminPanel\Player_login_status. php on line 38
12/03/2012 01:15 JohnHeatz#2
With the given error message you should be able to know what is wrong....on your .php file you are asking for a column that either does not exist, or has a different name than "LoginStatus"
12/03/2012 06:17 [Sick]Syndicate#3
Just for my opinion you may use the admin panel as you wish but do not get mad when someone hacks it and messes your server up knowing the admin panel is very easy to inject and hack just as a warning i am giving you to watch out for people that will do that, soon i will re release dash's admin panel that i got it secured finally.
12/03/2012 06:54 ..Zeus..#4
Run the 3 Queries to FIx the error:

Query 1
Quote:
USE PS_GameData
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
GO
ALTER TABLE dbo.Chars ADD
LoginStatus tinyint NOT NULL CONSTRAINT DF_Chars_LoginStatus DEFAULT 0
GO
COMMIT
Query 2
Quote:
USE PS_GameData
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO


ALTER Proc [dbo].[usp_Read_Chars_Detail2_R]

@CharID int

AS

SET NOCOUNT ON

DECLARE @UserUID int
DECLARE @Money bigint
DECLARE @GuildID int
DECLARE @GuildLevel tinyint
DECLARE @UID varchar (18)

-- 2005-12-30 스탯,스킬 이벤트관련...
DECLARE @Event1 tinyint
DECLARE @Event2 tinyint
--

SET @Money = 0
SET @UserUID = (SELECT UserUID FROM Chars WHERE CharID = @CharID)
SET @GuildID = (SELECT GuildID FROM GuildChars WHERE CharID = @CharID AND Del = 0)

IF(@UserUID IS NOT NULL)
BEGIN
SET @Money = (SELECT ISNULL([Money], 0) FROM UserStoredMoney WHERE UserUID = @UserUID)
END
ELSE
BEGIN
SET @Money = 0
END

IF(@GuildID IS NOT NULL)
BEGIN
SET @GuildLevel = (SELECT GuildLevel FROM GuildChars WHERE CharID = @CharID AND Del = 0)
END
ELSE
BEGIN
SET @GuildID = 0
SET @GuildLevel = 0
END

-- 2005-12-30 스탯,스킬 이벤트관련...
SELECT @Event1=Event1, @Event2=Event2 FROM CharEvents WHERE CharID=@CharID
--

SELECT UserUID, CharID, CharName, Slot, Family, Grow, Hair, Face, [Size], Job, Sex, [Level],
StatPoint AS DistPoint, SkillPoint, [Str], Dex, Rec, [Int], Luc, Wis, HP, MP, SP, Map, Dir, [Exp], [Money],
PosX, PosY, PosZ, Hg, Vg, Cg, Og, Ig, Del, K1, K2, K3, K4, @Money AS StoredMoney, @GuildID AS GuildID, @GuildLevel AS GuildLevel,

-- 전투공로관 보상레벨
KillLevel, DeadLevel,
--

-- 스탯,스킬 이벤트관련...
@Event1, @Event2,
--

DATEPART(yyyy, LeaveDate) AS LeaveDate_YYYY,
DATEPART(mm, LeaveDate) AS LeaveDate_MM,
DATEPART(dd, LeaveDate) AS LeaveDate_DD,
DATEPART(hh, LeaveDate) AS LeaveDate_HH,
DATEPART(mi, LeaveDate) AS LeaveDate_MI,
DATEPART(ss, LeaveDate) AS LeaveDate_SS

--

FROM Chars WHERE CharID = @CharID

-- 접속시간 기록
UPDATE Chars SET JoinDate=GETDATE(), LoginStatus = 1 WHERE CharID=@CharID
SELECT @UID=UserID FROM CHARS WHERE CharID=@CharID
UPDATE Chars SET LoginStatus = 0 WHERE (CharID<>@CharID) AND (UserID=@UID)
--

SET NOCOUNT OFF
SET QUOTED_IDENTIFIER OFF
SET ANSI_NULLS OFF
Query 3
Quote:
USE PS_GameData
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO


ALTER Proc [dbo].[usp_Save_Char_LeaveDate_R]

@CharID int

AS

SET NOCOUNT ON

-- 종료시간 기록
UPDATE Chars SET LeaveDate=GETDATE(), LoginStatus=0 WHERE CharID=@CharID

SET NOCOUNT OFF

SET QUOTED_IDENTIFIER OFF

SET ANSI_NULLS OFF
12/04/2012 19:57 diehard6#5
Actually these weren't the problems at all. I fixed it though, thanks!
12/04/2012 21:51 JohnHeatz#6
As this is fixed now

#Closed