• 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!

give back points function - things about data base

Xavicrak

New Member
Joined
Mar 23, 2010
Messages
186
Reaction score
4
Hi everybody, i am working on a function to make reset in my server.
this consist in: i will reset, so all the tables will be truncate, except account tables which has points.
for the ppl who has donate to my server i will give back the points, so, i have to see how many points they have spent on z_shop_history.

I am working on a consult to the data base that will select all the points (sum) and the account id.
That is:

SELECT Sum(price ) AS Total, from_account AS account_id INTO transactionsSummary
FROM z_shop_history_item
GROUP BY from_account

This should create another table with 2 columns: total and account_id, also we can add an index etc.

The problem is that in mysql this function is not working: This is the error:
#1327 - Undeclared variable: transactionsSummary

So I would like to do it in lua by doing consults.

But I found another problem, I think I must create a table with the variables i got from the consult.

With this I get all values:
local resultId = db.storeQuery("SELECT Sum(price) AS Total, from_account FROM z_shop_history_item GROUP BY from_account;")

NowI have to create the table as a local variable with it. Can somebody help me please?
 
Back
Top