Hello,
I have a problem with exporting the mySQL connection into the login script, the error is: "failed to call 'mySQL:dbConnection' [string'?']"
Here are the codes
mySQL.lua
local dbType="mysql"
local dbName="mta"
local dbHost="127.0.0.1"
local dbUsername="jingzhi"
local dbPassword=""
local dbConnection = dbConnect(dbType,"dbname="..dbName..";"..dbHost.."",dbUsername,dbPassword)
if dbConnection then
outputDebugString("MySQL has been successfuly connected!")
else
outputDebugString("Failed to connect to MySQL!")
end
function dbConnection()
return dbConnection
end
meta.xml
"JingZhi" type="script" />
login.lua
local dbConnection = exports["mySQL"]:dbConnection()