elnelson
Lunaria World Dev
Hello, im trying to get this table result:
with this code:
But its driving me crazy trying to get the correct format, i get this result:
It is not correct, its merging all the existing items from table, anyone know how to solve this?
My table in PhPMyAdmin looks like this:
"did" is the id i want to separate in groups like i said on first example.

im using OTX 1.0.X.S - 4 (GitHub - mattyx14/otxserver: OTX Server from: (https://github.com/mattyx14/otxserver/))
Lua:
Pending to retrieve:
[ID: 75985 | Name: None]
1 - plate armor
[ID: 75999 | Name: None]
100 - crystal coin
[ID: 76483 | Name: None]
1 - knight armor
1 - boots of haste
with this code:
Lua:
local text = ""
local str = ""
local check_id = db.getResult("SELECT `pid2`, `did`, `itemid`, `count`,`city`, `payment` FROM `player_tradeitems` WHERE `pid` = " .. getPlayerGUID(cid) .. ";")
if (check_id:getID() ~= -1) then
while (true) do
local receiver = check_id:getDataInt("pid2")
local did = check_id:getDataInt("did")
local name = check_id:getDataInt("itemid")
local count = check_id:getDataInt("count")
local city = check_id:getDataInt("city")
local payment = check_id:getDataInt("payment")
str = str.." "..count.." - "..getItemNameById(tonumber(name)).."\n"
text = text.."[ID: "..did.." | Name: None]\n"..str
if not(check_id:next()) then
break
end
end
end
doShowTextDialog(cid, 2334, "Insert transaction ID to reclaim:\n\nTransactions:\nPending to retrieve:\n"..text.."")
But its driving me crazy trying to get the correct format, i get this result:
Code:
Pending to retrieve:
[ID: 75985 | Name: None]
1 - plate armor
[ID: 75999 | Name: None]
1 - plate armor
100 - crystal coin
[ID: 76483 | Name: None]
1 - plate armor
100 - crystal coin
1 - knight armor
[ID: 76483 | Name: None]
1 - plate armor
100 - crystal coin
1 - knight armor
1 - boots of haste
It is not correct, its merging all the existing items from table, anyone know how to solve this?
My table in PhPMyAdmin looks like this:
"did" is the id i want to separate in groups like i said on first example.

im using OTX 1.0.X.S - 4 (GitHub - mattyx14/otxserver: OTX Server from: (https://github.com/mattyx14/otxserver/))
Last edited: