Closed silverdeath200282 closed 9 years ago
It should say local test = "Gyovo"
Note the quotes!
Yeah I've tried with or without the quotes. Same thing either way.
Your use of quotes seems off. Checking using an editor with syntax highlighting will help.
In any case, those are syntax errors in your program, and not a bug in LuaSQL. Closing this entry now, but feel free to ask for help through other channels! (Lua mailing list, IRC channel, etc. - see the Community page in lua.org for details.)
I'm trying to use a variable in the Where = field of the SQL Query. With the code below, it says expecting a ) near test. When I try to change it to: WHERE firstname = '"..test.."'"), I get "attempt to concatenate a nil value"
Can someone tell me if this is a bug or just the wrong syntax? Thanks
local test = Gyovo
local env = luasql.mysql() local con = env:connect("db_name","root","password","localhost","3306") cur = con:execute("SELECT name FROM characters WHERE firstname = '"test"'") row = cur:fetch ({}, "a") while row do print(string.format("%s", row.characters))
end cursor:close() conn:close() env:close()