I am trying to use luasql.mysql and execute multiple INSERT statements from a file to a mysql database. I can not seem to figure out how to use a string variable instead of using a string. I want to execute from a for loop, looping though a file of strings. Any help would be appreciated.
mysql = require "luasql.mysql"
local env = mysql.mysql()
local conn = env:connect('mydb','myusername','mypassword','myip')
print(env,conn)
file = io.open("sqldumps.sql")
lines = file:lines()
print("Contents of file:");
for line in lines do
status,errorString = conn:execute( '"line"' )
print(status,errorString )
end