Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[RELEASE-REPOSTED] WebAdmin PHP add GC/Dollar/Item Quantity

Junior Spellweaver
Joined
Apr 5, 2012
Messages
148
Reaction score
5
how about this error with the SQL?

already I made the dbo.Donation_Log
LukasCCB - [RELEASE-REPOSTED] WebAdmin PHP add GC/Dollar/Item Quantity - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Joined
Apr 23, 2013
Messages
1,172
Reaction score
1,796
how about this error with the SQL?

already I made the dbo.Donation_Log
LukasCCB - [RELEASE-REPOSTED] WebAdmin PHP add GC/Dollar/Item Quantity - RaGEZONE Forums

change word ALTER to CREATE or try this

PHP:
CREATE PROCEDURE [dbo].[Add_Donation]    -- @in_CustomerID int,    @in_Email VARCHAR(128),    @in_GamePoints INT,    @in_GameDollars INT,    @in_ItemID INT,    @in_Quantity INTASBEGIN      DECLARE @in_CustomerID INT    SELECT @in_CustomerID = CustomerID FROM Accounts WHERE email = @in_Email      -- Add GC    IF(@in_GamePoints > 0) BEGIN        UPDATE UsersData SET GamePoints=(GamePoints+@in_GamePoints) WHERE CustomerID=@in_CustomerID    END      -- Add Money    IF(@in_GameDollars > 0) BEGIN        UPDATE UsersData SET GameDollars=(GameDollars+@in_GameDollars) WHERE CustomerID=@in_CustomerID    END      DECLARE [USER=162874]account[/USER]Type INT    SELECT [USER=162874]account[/USER]Type=AccountType FROM UsersData WHERE CustomerID=@in_CustomerID      -- Add Legend    IF   [USER=162874]account[/USER]Type = 2 AND @in_GamePoints >= 50000 AND @in_GameDollars >= 50000) BEGIN            UPDATE UsersData SET                   AccountType=0            WHERE CustomerID=@in_CustomerID    END      -- Add Item to global inventory    IF(@in_ItemID != 0 AND @in_Quantity != 0) BEGIN        INSERT INTO UsersInventory (CustomerID,CharID,BackpackSlot,ItemID,LeasedUntil,Quantity,Var1,Var2)        VALUES (@in_CustomerID,0,0,@in_ItemID,getdate(),@in_Quantity,-1,-1)    END      -- Insert to Donation_Log    IF(@in_GamePoints > 0 OR @in_GameDollars > 0 OR @in_ItemID != 0 AND @in_Quantity != 0) BEGIN        INSERT INTO Donation_Log (CustomerID,Email,GamePoints,GameDollars,ItemID, Quantity, TIME)        VALUES (@in_CustomerID, @in_Email, @in_GamePoints, @in_GameDollars, @in_ItemID, @in_Quantity, GETDATE())    END  END
 
Junior Spellweaver
Joined
Apr 5, 2012
Messages
148
Reaction score
5
change word ALTER to CREATE or try this

PHP:
CREATE PROCEDURE [dbo].[Add_Donation]    -- @in_CustomerID int,    @in_Email VARCHAR(128),    @in_GamePoints INT,    @in_GameDollars INT,    @in_ItemID INT,    @in_Quantity INTASBEGIN      DECLARE @in_CustomerID INT    SELECT @in_CustomerID = CustomerID FROM Accounts WHERE email = @in_Email      -- Add GC    IF(@in_GamePoints > 0) BEGIN        UPDATE UsersData SET GamePoints=(GamePoints+@in_GamePoints) WHERE CustomerID=@in_CustomerID    END      -- Add Money    IF(@in_GameDollars > 0) BEGIN        UPDATE UsersData SET GameDollars=(GameDollars+@in_GameDollars) WHERE CustomerID=@in_CustomerID    END      DECLARE [USER=162874]account[/USER]Type INT    SELECT [USER=162874]account[/USER]Type=AccountType FROM UsersData WHERE CustomerID=@in_CustomerID      -- Add Legend    IF   [USER=162874]account[/USER]Type = 2 AND @in_GamePoints >= 50000 AND @in_GameDollars >= 50000) BEGIN            UPDATE UsersData SET                   AccountType=0            WHERE CustomerID=@in_CustomerID    END      -- Add Item to global inventory    IF(@in_ItemID != 0 AND @in_Quantity != 0) BEGIN        INSERT INTO UsersInventory (CustomerID,CharID,BackpackSlot,ItemID,LeasedUntil,Quantity,Var1,Var2)        VALUES (@in_CustomerID,0,0,@in_ItemID,getdate(),@in_Quantity,-1,-1)    END      -- Insert to Donation_Log    IF(@in_GamePoints > 0 OR @in_GameDollars > 0 OR @in_ItemID != 0 AND @in_Quantity != 0) BEGIN        INSERT INTO Donation_Log (CustomerID,Email,GamePoints,GameDollars,ItemID, Quantity, TIME)        VALUES (@in_CustomerID, @in_Email, @in_GamePoints, @in_GameDollars, @in_ItemID, @in_Quantity, GETDATE())    END  END

thats php code D:? bad way to implement in sql can share it in code tag?
 
Junior Spellweaver
Joined
Apr 5, 2012
Messages
148
Reaction score
5
he using a php tag in sql codes, did you try to use this query? you get a lot of error coz many things are in comments because is a query unordered :s and its hard to get it work but n1 release
 
Initiate Mage
Joined
May 12, 2015
Messages
2
Reaction score
0
fix ......
CREATE PROCEDURE [dbo].[Add_Donation] -- @in_CustomerID int,
@in_Email VARCHAR(128),
@in_GamePoints INT,
@in_GameDollars INT,
@in_ItemID INT,
@in_Quantity INT
AS
BEGIN

DECLARE @in_CustomerID INT
SELECT @in_CustomerID = CustomerID FROM Accounts WHERE email = @in_Email

-- Add GC
IF(@in_GamePoints > 0) BEGIN
UPDATE UsersData SET GamePoints=(GamePoints+@in_GamePoints) WHERE CustomerID=@in_CustomerID
END

-- Add Money
IF(@in_GameDollars > 0)BEGIN
UPDATE UsersData SET GameDollars=(GameDollars+@in_GameDollars) WHERE CustomerID=@in_CustomerID
END

DECLARE @accountType INT
SELECT @accountType=AccountType FROM UsersData WHERE CustomerID=@in_CustomerID

-- Add Legend
IF (@accountType = 2 AND @in_GamePoints >= 50000 AND @in_GameDollars >= 50000)BEGIN
UPDATE UsersData SET
AccountType=0
WHERE CustomerID=@in_CustomerID
END

-- Add Item to global inventory
IF(@in_ItemID != 0 AND @in_Quantity != 0) BEGIN
INSERT INTO UsersInventory (CustomerID,CharID,BackpackSlot,ItemID,LeasedUntil,Quantity,Var1,Var2)
VALUES (@in_CustomerID,0,0,@in_ItemID,getdate(),@in_Quantity,-1,-1)
END

-- Insert to Donation_Log
IF(@in_GamePoints > 0 OR @in_GameDollars > 0 OR @in_ItemID != 0 AND @in_Quantity != 0) BEGIN
INSERT INTO Donation_Log (CustomerID,Email,GamePoints,GameDollars,ItemID, Quantity, TIME)
VALUES (@in_CustomerID, @in_Email, @in_GamePoints, @in_GameDollars, @in_ItemID, @in_Quantity, GETDATE())
END
END
 
Joined
Apr 23, 2013
Messages
1,172
Reaction score
1,796
Sorry, my PC is down :(:
This is link fixed and re-uploaded:

From Linux Zorin.



fix ......

mine is running smoothly.
thank you for share your code.



he using a php tag in sql codes, did you try to use this query? you get a lot of error coz many things are in comments because is a query unordered :s and its hard to get it work but n1 release

do it yourself, it is useful for those who do not know, do not complain.



how about this error with the SQL?

already I made the dbo.Donation_Log
LukasCCB - [RELEASE-REPOSTED] WebAdmin PHP add GC/Dollar/Item Quantity - RaGEZONE Forums

no no hahahaha, this is SQL on NaviCat>Function or execute this in SQL Server 2008
 
Back
Top