this was posted by @Yuri-BR
more was excluded, I was back up here and took a edited.
http://i.imgur.com/aTrUnH5.png
Download: Mega.nz
Function: Pastebin.com
Table Log (Donation_Log): https://i.imgur.com/OLQ9Sne.png
Code: Sergey Titov
Edit: lukasccb
Printable View
this was posted by @Yuri-BR
more was excluded, I was back up here and took a edited.
http://i.imgur.com/aTrUnH5.png
Download: Mega.nz
Function: Pastebin.com
Table Log (Donation_Log): https://i.imgur.com/OLQ9Sne.png
Code: Sergey Titov
Edit: lukasccb
how about this error with the SQL?
already I made the dbo.Donation_Log
http://forum.ragezone.com/attachment...d=155324&stc=1
Wow! Thank you!
change word ALTER to CREATE or try this
PHP Code: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 [MENTION=162874]account[/MENTION]Type INT SELECT [MENTION=162874]account[/MENTION]Type=AccountType FROM UsersData WHERE CustomerID=@in_CustomerID -- Add Legend IF [MENTION=162874]account[/MENTION]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
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
fix ......
Quote:
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
Sorry, my PC is down :(:
This is link fixed and re-uploaded: https://mega.nz/#!SUt3RQBB!sDpCBLIic...H3ku-qr1uXt5cQ
From Linux Zorin.
- - - Updated - - -
mine is running smoothly.
thank you for share your code.
- - - Updated - - -
do it yourself, it is useful for those who do not know, do not complain.
- - - Updated - - -
no no hahahaha, this is SQL on NaviCat>Function or execute this in SQL Server 2008
please re upload because link broken