tmysql returning nill

Error: attempt to concatenate a nil value @ line 6

[lua]
local pMeta = FindMetaTable(“Player”)

function pMeta:GetCoins()
local strquery = “SELECT coins FROM players WHERE steamid = '”…self:SteamID()…"’"
print(strquery) – Prints “SELECT coins FROM players WHERE steamid = ‘STEAM_0:0:1859’”
print("query - "…tmysql.query(strquery)) – error occurs here
end
[/lua]

When I run this query in PhpMyAdmin it returns the value I want.

I am using tmysql3.

You can’t call the strquery because it is a boolean, it will return true or false. Do this instead.
[lua]local pMeta = FindMetaTable(“Player”)

function pMeta:GetCoins()
local strquery = “SELECT coins FROM players WHERE steamid = '”…self:SteamID()…"’"
print(strquery) – Prints “SELECT coins FROM players WHERE steamid = ‘STEAM_0:0:1859’”
print("query - "…strquery) – error occurs here
end[/lua]

Then the query wont get ran…

I don’t know how much TmySQL differs from SQLi but you could try and code it a little differently to produce the query and result, for example.
[lua]local pMeta = FindMetaTable(“Player”)

function pMeta:GetCoins()
// Set the SQL query string
local query = “SELECT coins FROM players WHERE steamid = '”…self:SteamID()…"’"
// Perform the query from the string above
local result = sql.Query(query)

// Runs if query has been successful or not, I presume to check that the STEAMID has been fetched?
print(query)

// Check if the query has worked
if (result) then
print(“Query has been successfully performed”)
else
print(“Query could not be performed”)
// Below code tells the console what the error was
print(sql.LastError(result))
end
end[/lua]
Is that what you were looking for?

No…

Care to elaborate? I think it’s a little discourteous to reply in such a manner to someone who is trying to help you.

Nvm. Fixed this by using a callback function.