Witam, mam problem zpolaczeniem z baza mysql. Moj skrypt
local hostname = get( "hostname" ) or "SQL09.FREEMYSQL.NET"
local username = get( "username" ) or "nazwa usera"
local password = get( "password" ) or "haslo"
local database = get( "database" ) or "nazwa bazy"
local port = tonumber( get( "port" ) ) or 3306
function connectToDatabase(res)
MySQLConnection = mysql_connect(hostname, username, password, database, port)
if (not MySQLConnection) then
if (res == getThisResource()) then
cancelEvent(true, "Cannot connect to the database.")
end
return nil
end
return nil
end
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), connectToDatabase, false)
po uruchomieniu skrypt pokazuje blad
ERROR: \mysql\connect.lua:12: attempt to call global 'mysql_connect' (a nil value)