• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[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,797
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,797
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