Executes a mysql query and returns the result as a table
int MySQLConnection:query([function callback, ] string query [, ...optionalParameters])
table - Query result. May be an empty table if no matching results. nil if the query failed
if MySQLTests.query then local result = connection:query("SELECT * FROM test_table WHERE name = ?", {"dizzo"}) print("Got #"..#result.." results") if #result > 0 then local row = result[1] print("["..type(row.id).."] "..row.id.." => ["..type(row.name).."] "..row.name) end end
There was an error while loading. Please reload this page.