Otfan125
Well-Known Member
Hey guys, I'm trying to write a script that gets executed and sets a condition on a player based on some SQL entry in the 'players' table... I'm using TFS 1.3 if thats useful.
What I'm trying to do is create a onLogin script that reads the database and checks if a player has a specific value in a specific column in 'players'... or, for example:
here, 'blademaster' is the column in each player's table that I'm trying to retrieve, though I get the error:
or
Any pointers? Whats the proper SQL synthax? Thanks
What I'm trying to do is create a onLogin script that reads the database and checks if a player has a specific value in a specific column in 'players'... or, for example:
Lua:
function onLogin(player)
local res = db.storeQuery("SELECT `blademaster` FROM `players` WHERE `name` = `Angel` ;")
print(res)
return true
end
here, 'blademaster' is the column in each player's table that I'm trying to retrieve, though I get the error:
Code:
Angel has logged in.
[Error - mysql_real_query] Query: SELECT `blademaster` FROM `players` WHERE `players` = `Angel` ;
Message: Unknown column 'players' in 'where clause'
[Error - mysql_store_result] Query: SELECT `blademaster` FROM `players` WHERE `players` = `Angel` ;
Message: Unknown column 'players' in 'where clause'
false
or
Code:
Angel has logged in.
[Error - mysql_real_query] Query: SELECT `blademaster` FROM `players` WHERE `name` = `Angel` ;
Message: Unknown column 'Angel' in 'where clause'
[Error - mysql_store_result] Query: SELECT `blademaster` FROM `players` WHERE `name` = `Angel` ;
Message: Unknown column 'Angel' in 'where clause'
false