Wysłany: 2017-09-16, 15:15
PixelMilYT
Wiek: 27 Na forum: 3320 dni Posty: 1
Nick w MP: PixelMil
Tak jak w temacie czyli: Jak pod?aczyc MySQL pod OGRPG?
Wysłany: 2017-09-17, 12:02
Eitho
Wiek: 24 Na forum: 3489 dni Posty: 330
Nick w MP: Eitho
Piwa : 746
[ServerProject]
1. Wchodzisz na panel zarz?dzania baz? danych SVPJ.
2. Tutaj masz napisane wszystkie dane do bazy.
3. Uzupe?niasz skrypt ogrpg-db w nast?puj?cy spos?b:
--[[
Resource : OURGame v2
Developers : Split < split . programista @ gmail . com >
You have no right to use this code without my permission .
( c ) 2015 < split . programista @ gmail . com >. All rights reserved .
]]
-- Settings
DBHandler = nil
DBName = "Nazwa bazy danych"
DBUser = "Login / username"
DBPass = "Has?o"
DBHost = "Host / IP Adress"
-- Functions
function dbSet (...)
if not {...} then return end
local stringe = dbPrepareString ( DBHandler ,...)
local query = dbExec ( DBHandler , stringe )
return query
end
function dbGet (...)
if not {...} then return end
local stringe = dbPrepareString ( DBHandler ,...)
local query = dbQuery ( DBHandler , stringe )
local result = dbPoll ( query , - 1 )
return result
end
addEventHandler ( "onResourceStart" , resourceRoot , function()
DBHandler = dbConnect ( "mysql" , "dbname=" .. DBName .. ";host=" .. DBHost .. "" , DBUser , DBPass , "share=1;autoreconnect=1" )
if DBHandler then
outputDebugString ( "* Connect to server MYSQL..." )
dbSet ( "SET NAMES utf8" )
else
outputDebugString ( "* No Connecting to server MYSQL.." )
end
end )
W przypadku innego hostingu wygl?da to podobnie.
Tagi: jak :: podłaczyc :: mysql :: pod :: ogrpg?
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: