01-10-2014, 06:59 AM
I *think* you need to do:
Don't forget to use "local" whenever possible, you don't want to pollute the global namespace too much. Also "local" has faster access than global.
When pasting code in the forum, you can use [ shcode=lua ] code [ /shcode ] (without the spaces around brackets) to have the code syntax-highlighted.
local luasql = require ("luasql.mysql"); -- Put the loaded library in the variable local env = assert(luasql.mysql()); -- Use that variable to access the library
Don't forget to use "local" whenever possible, you don't want to pollute the global namespace too much. Also "local" has faster access than global.
When pasting code in the forum, you can use [ shcode=lua ] code [ /shcode ] (without the spaces around brackets) to have the code syntax-highlighted.