Wysłany: 2018-05-20, 20:38
AkossPL
Wiek: 25 Na forum: 4079 dni Posty: 140
Nick w MP: AkossPL
Piwa : 3
mam problem wszystko dobrze robi? i nie mog? si? po?onczy?
--[[
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 = "xxx"
DBUser = "xxx"
DBPass = "xxx"
DBHost = "xxx"
-- 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 , num_affected_rows , last_insert_id = 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 ( "* Po??czono pomy?lnie! (MySQL)" )
dbSet ( "SET NAMES utf8" )
else
outputDebugString ( "* Brak po??czenia! (MySQL)" )
end
end )
local SQL_LOGIN = "xxx"
local SQL_PASSWD = "xxx"
local SQL_DB = "xxx"
local SQL_HOST = "xxx"
local SQL_PORT = 3306
local root = getRootElement ()
local SQL
local function connect ()
SQL = mysql_connect ( SQL_HOST , SQL_LOGIN , SQL_PASSWD , SQL_DB , SQL_PORT )
if ( not SQL ) then
outputServerLog ( "BRAK POLACZENIA Z BAZA DANYCH!" )
else
mysql_query ( SQL , "SET NAMES utf8" )
-- outputServerLog ( "Modul mysql polaczony!" )
end
end
local function keepAlive ()
if ( not mysql_ping ( SQL )) then
outputServerLog ( "Zerwane polaczenie z baza danych, nawiazywanie..." )
connect ()
end
end
addEventHandler ( "onResourceStart" , getResourceRootElement (),function()
connect ()
setTimer ( keepAlive , 30000 , 0 )
end )
function esc ( value )
return mysql_escape_string ( SQL , value )
end
function pobierzTabeleWynikow ( query )
local result = mysql_query ( SQL , query )
if ( not result ) then
outputDebugString ( "mysql_query failed: (" .. mysql_errno ( SQL ) .. ") " .. mysql_error ( SQL ))
outputServerLog ( "mysql_query failed: (" .. mysql_errno ( SQL ) .. ") " .. mysql_error ( SQL ))
return nil
end
local tabela ={}
for result , row in mysql_rows_assoc ( result ) do
table . insert ( tabela , row )
end
mysql_free_result ( result )
return tabela
end
function q ( sQuery , ...)
local qHandler = dbQuery ( CDatabase . hCon , sQuery , ...)
local result , iRows , sError = dbPoll ( qHandler , 90 )
if result == nil then
result , iRows , sError = dbPoll ( qHandler , - 1 )
if result == nil then
dbFree ( qHandler )
outputDebugString ( 'Max query runtime reached: ' .. sQuery .. '|' .. iRows .. '|' .. sError )
return false
end
end
if result == false then
outputDebugString ( 'Error executing query: ' .. sQuery .. '|' .. iRows .. '|' .. sError )
return false
end
return result , iRows , ( sError or '-' )
end
function pobierzWyniki ( query )
local result = mysql_query ( SQL , query )
if ( not result ) then return nil end
row = mysql_fetch_assoc ( result )
mysql_free_result ( result )
return row
end
function zapytanie ( query )
local result = mysql_query ( SQL , query )
if ( result ) then mysql_free_result ( result ) return true end
return
end
function insertID ()
return mysql_insert_id ( SQL )
end
function affectedRows ()
return mysql_affected_rows ( SQL )
end
function fetchRows ( query )
local result = mysql_query ( SQL , query )
if ( not result ) then return nil end
local tabela ={}
while true do
local row = mysql_fetch_row ( result )
if ( not row ) then break end
table . insert ( tabela , row )
end
mysql_free_result ( result )
return tabela
end
function getSQLLink ()
return SQL
end
tutaj b??dy w konsoli
[New WorldV3]/[BAZA]/ogrpg-db/s_db.lua:27: dbPoll failed; Ta
ble 'db_33192.ogrpg_jobs' doesn't exist
Wysłany: 2018-05-20, 20:58
DaVeCS
Mapper
Wiek: 31 Na forum: 3386 dni Posty: 193
Nick w MP: DaVe
Piwa : 59
Wed?ug b??du to nie posiadasz tabeli ogrpg_jobs
Wysłany: 2018-05-20, 21:03
AkossPL
Wiek: 25 Na forum: 4079 dni Posty: 140
Nick w MP: AkossPL
Piwa : 3
To wiesz jak to zrobi? bo ja tak za bardzo to nie wiem
Wysłany: 2018-05-20, 21:30
Maksasior
B)
Wiek: 24 Na forum: 3581 dni Posty: 47
Nick w MP: tomals0n
Piwa : 34
Pobierz nowe ogrpg_jobs
Podpis
--Szatan:
Wysłany: 2018-05-20, 21:41
AkossPL
Wiek: 25 Na forum: 4079 dni Posty: 140
Nick w MP: AkossPL
Piwa : 3
a sk?d mam to wsi??? ogrpg_jobs
Wysłany: 2018-05-20, 22:09
Maksasior
B)
Wiek: 24 Na forum: 3581 dni Posty: 47
Nick w MP: tomals0n
Piwa : 34
AkossPL , we? jak?? paczke pobierz i b?dzie mie? pewnie xd
Podpis
--Szatan:
Wysłany: 2018-05-20, 22:10
AkossPL
Wiek: 25 Na forum: 4079 dni Posty: 140
Nick w MP: AkossPL
Piwa : 3
robi?em ju? tak i dalej nie dzia?a
Wysłany: 2018-05-21, 15:47
Kuks*
Wiek: 15 Na forum: 3030 dni Posty: 246
Nick w MP: Kuks*
Piwa : 2208
"Maksasior" napisał/a :
xDDDDDDDDD
Jak tabeli nie ma w mysql to po co ma pobiera? nowy skrypt?
Ju? pomog?em na pw
Tagi: nie :: mogę :: się :: połączyć :: mysql
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: