Hey guys,
I'm with a little problem....
I'm using TFS 1.2 and i don't know how can i get more than 1 result at a database...
In TFS 0.3.6 i can do it like this:
But at TFS 1.2 it doesn't work... i tried like this:
But it only return one of the tasks... can anyone help me?
I'm with a little problem....
I'm using TFS 1.2 and i don't know how can i get more than 1 result at a database...
In TFS 0.3.6 i can do it like this:
Lua:
local result = db.getResult("SELECT * FROM `tasks` WHERE `player_name` = '" .. player:getName() .. "' AND `status` = 'aberto'")
if result:getID() ~= -1 then
repeat
--here comes your code
until not result:next()
end
But at TFS 1.2 it doesn't work... i tried like this:
Code:
function onSay(player, words, param)
local player = Player(player)
local r = db.storeQuery("SELECT * FROM `tasks` WHERE `player_name` = '" .. player:getName() .. "' AND `status` = 'aberto'")
repeat
player:sendTextMessage(2,result.getDataString(r, 'task'))
--here comes your code
until not result:next()
return false
end
But it only return one of the tasks... can anyone help me?