• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Return premium points from z_shop_offer_history

narko

vertrauenswürdig ~
Joined
Oct 19, 2008
Messages
1,317
Solutions
2
Reaction score
132
Location
Unknown
Hi all, as the tittle says I wonder if some of you with dabatase skills could help me with this task, for example:
Code:
INSERT INTO `z_shop_history_item` (`id`, `to_name`, `to_account`, `from_nick`, `from_account`, `price`, `offer_id`, `trans_state`, `trans_start`, `trans_real`) VALUES
(1121, 'Testchar', 8743, 'Anonymous', 8743, 10, 'Yalahari Mask', 'realized', 1420579552, 1420579561),

(This is only one of the 11000 lines, that is why I am asking for help)

Transaction ID = 1121
Character's name: Testchar
Account ID = 8743 -- should be envolved
Points = 10 = should be envolved

I want to convert that to:
Code:
UPDATE from accounts premium_points = premium_points+'old_points'  WHERE id = 'old_account'

It's clearly that the query has a bad format but I think is understandable. I think that it has to be a php script to do that.

If any of you know how to conplete this task, post here. I'd pay through PayPal if needeed.
 
Code:
UPDATE `accounts` SET `premium_points` = `premium_points` + (SELECT SUM(`price`) FROM `z_shop_history_item` WHERE `z_shop_history_item`.`from_account` = `accounts`.`id`)
I'm going to test it as soon as I get home, thank you.

Edit: Just tested it and the amount of points are really high, it seems like something isn't working properly. I figured that out because the items costs like 15-30 points, not that expensive.
g4F9V-Eti.png
 
Last edited:
I suggest that you run this query to verify whether the amount is incorrect or not.
Code:
SELECT SUM(`price`) FROM `z_shop_history_item` WHERE `from_account` = accountId
 
Back
Top