-- Settings
DBHandler=nil
DBName="NAME" (tu oczywi?cie mam wszystko wpisane tak jak ma by?)
DBUser="USER" (tu oczywi?cie mam wszystko wpisane tak jak ma by?)
DBPass="PASS" (tu oczywi?cie mam wszystko wpisane tak jak ma by?)
DBHost="HOST" (tu oczywi?cie mam wszystko wpisane tak jak ma by?)
-- Functions
function dbSet(...)
if not {...} then return end
local query=dbExec(DBHandler, ...)
return query
end
function dbGet(...)
if not {...} then return end
local query=dbQuery(DBHandler, ...)
local result=dbPoll(query, -1)
return result
end
addEventHandler("onResourceStart", resourceRoot, function()
DBHandler=dbConnect("mysql", "dbname="..DBName..";host="..DBHost.."", DBUser, DBPass, "share=1")
if DBHandler then
outputDebugString("* Connect to server MYSQL...")
else
outputDebugString("* No Connecting to server MYSQL..")
end
end)