Error - attempt to concatenate a table value @ last line
[lua]
function MySQL_Select_Query(query)
local db, error = mysql.connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DATA)
if (db == 0) then
print("error "..tostring(error) .. "\n") return ''
end
local querylol = mysql.query(db, query)
mysql.disconnect(db)
return querylol
end
local query = "SELECT name FROM characters WHERE name = '"..name.."'"
print("ssl - "..MySQL_Select_Query(query))
[/lua]
-- nvm bad reading
unpack(MySQL_Select_Query(query)) or use table.concat, to do the same thing
Or select which index it is you want the value of.
The query is returning a table not nil or NULL.
I don't understand why it is returning a table though.
[editline]
Fixed it and thanx Flapadar
[QUOTE=iRzilla;26647623]Because of the way it's stored. Why would it return one result when there can be multiple results?[/QUOTE]
Yea, thank you. I need to start thinking before I post lol.
Sorry, you need to Log In to post a reply to this thread.