Wysłany: 2016-02-20, 10:29
Patrix100
Amator LUA.
Wiek: 26 Na forum: 3887 dni Posty: 182
Nick w MP: .:Patrix:.
Piwa : 952
Witam, moglby mi ktos dac kod na polaczenie serwera z mysql? I powie o co chodzi z tymi tabelkami?
Wysłany: 2016-02-20, 11:22
MIKAELmta
Wiek: 24 Na forum: 3978 dni Posty: 311
Piwa : 10617
DBHandler = nil
DBName = "..."
DBUser = "..."
DBPass = "..."
DBHost = "..."
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 )
Znalaz?em co? takiego na dysku
Wysłany: 2016-02-20, 11:31
Patrix100
Amator LUA.
Wiek: 26 Na forum: 3887 dni Posty: 182
Nick w MP: .:Patrix:.
Piwa : 952
"MIKAELmta" napisał/a :
DBHandler = nil
DBName = "..."
DBUser = "..."
DBPass = "..."
DBHost = "..."
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 )
Znalaz?em co? takiego na dysku
Powiesz mi jeszcze o co chodzi z tymi tabelkami w mysql i wgl?
Wysłany: 2016-02-20, 14:18
Gerano
Mleko,Kakao,LUA
Wiek: 38 Na forum: 4266 dni Posty: 187
Nick w MP: Gerano
Piwa : 1460
Tabelki w mysql po prostu s? po to aby zapisywa? dane gracza,auta,serwera og?lnie to co napiszesz pod mysql i zrobisz tabelki to b?dzie to zapisywane tam i masz pewno?? ?e jak padnie ci serwer to kasa gracza,auta i inne rzeczy po w??czeniu serwera i skrypt?w b?d? dalej
Podpis
BUDOWA SERWERA: XXX
Prace: XXX%
Wysłany: 2016-02-20, 14:30
Patrix100
Amator LUA.
Wiek: 26 Na forum: 3887 dni Posty: 182
Nick w MP: .:Patrix:.
Piwa : 952
"Gerano" napisał/a :Tabelki w mysql po prostu s? po to aby zapisywa? dane gracza,auta,serwera og?lnie to co napiszesz pod mysql i zrobisz tabelki to b?dzie to zapisywane tam i masz pewno?? ?e jak padnie ci serwer to kasa gracza,auta i inne rzeczy po w??czeniu serwera i skrypt?w b?d? dalej
A jak stworzyc taka tabelke pod jakis skrypt?
Wysłany: 2016-02-20, 14:33
Gerano
Mleko,Kakao,LUA
Wiek: 38 Na forum: 4266 dni Posty: 187
Nick w MP: Gerano
Piwa : 1460
najpierw polecam nauczy? si? troszk? mysql bo tak na szybko nie da si? tego nauczy?
Podpis
BUDOWA SERWERA: XXX
Prace: XXX%
Tagi: kod
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: