• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua TFS 0.4 db.getResult

Hernest

New Member
Joined
Jul 26, 2010
Messages
152
Reaction score
3
Location
poland
Code:
local gpoints = db.getResult("SELECT `event_points` FROM 'accounts' WHERE `name` = '" .. getAccountByName(getCreatureName(cid)) .. "' LIMIT 1;")
if(msgcontains(msg, 'points')) then
npcHandler:say("Points: " .. gpoints .. ".", cid)
end

Code:
mysql_real_query(): SELECT `event_points` FROM 'accounts' WHERE `name` = 'fioletowy' LIMIT 1; - MYSQL ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''accounts' WHERE `name` = 'fioletowy' LIMIT 1' at line 1 (1064)

This code is used by npc as you can see. Any ideas how to fix it?
It's mysql 5.5.43, TFS 0.4.
 
Code:
local gpoints = db.getResult("SELECT `event_points` FROM `accounts` WHERE `name` = '" .. getAccountByName(getCreatureName(cid)) .. "' LIMIT 1;")
if(msgcontains(msg, 'points')) then
    npcHandler:say("Points: " .. gpoints .. ".", cid)
end
 
Back
Top