|
Wysłany: 2018-02-04, 21:58
|
|
Dani3l_105


Wiek: 26 Na forum: 3754 dni Posty: 21
Nick w MP: Dziki
|
|
|
|
Witajcie, mam paczke skygame i mam nastepujace problemy:
- mam wgrany modul linuxa i folder modules,
- dodalem resource.*, admin, core
- dodalem co confinga <module src="mta_mysql.so" />
[21:29] ERROR: [Podstawa]/[bazydanych]/ogrpg-db/s_db.lua:91: attempt to call global 'mysql_query' (a nil value)
[21:29] ERROR: [Podstawa]/[serwer]/ogrpg-vehicles/s_vehbuy.lua:485: call: failed to call 'ogrpg-db:pobierzWyniki' [string "?"]
|
|
|
|
|
|
|
Wysłany: 2018-02-04, 22:03
|
|
Ciastuuś
Truck soon...


Wiek: 26 Na forum: 3071 dni Posty: 799
Nick w MP: Ciastuuś
Piwa: 4297
|
|
|
|
Masz b??dny zas?b, kt?ry ??czy baz? danych... Jak si? nie myl? to w ogrpg-db nie by?o pobierzWyniki tylko w DB2
|
|
|
|
|
|
|
|
|
Wysłany: 2018-02-04, 22:15
|
|
Dani3l_105


Wiek: 26 Na forum: 3754 dni Posty: 21
Nick w MP: Dziki
|
|
|
|
nie wiem jak to naprawic, a Ty wiesz?
|
|
|
|
|
|
|
Wysłany: 2018-02-04, 22:18
|
|
Ciastuuś
Truck soon...


Wiek: 26 Na forum: 3071 dni Posty: 799
Nick w MP: Ciastuuś
Piwa: 4297
|
|
|
|
Poka? jak wygl?da zawarto?? zasobu ogrpg-db
|
|
|
|
|
|
|
|
|
Wysłany: 2018-02-04, 22:23
|
|
Dani3l_105


Wiek: 26 Na forum: 3754 dni Posty: 21
Nick w MP: Dziki
|
|
|
|
--[[
Resource: OURGame v2
Developers: Split <[email protected]>
You have no right to use this code without my permission.
(c) 2015 <[email protected]>. All rights reserved.
]]
-- Settings
DBHandler=nil - A TO?
DBName="x"
DBUser="x"
DBPass="x"
DBHost="x"
-- 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)
local SQL_LOGIN="x"
local SQL_PASSWD="x" - TU MA BYC TO SAMO CO NA POCZATKU?
local SQL_DB="x"
local SQL_HOST="x"
local SQL_PORT=x
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
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 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
|
|
|
|
|
|
|
Wysłany: 2018-02-04, 22:33
|
|
Ciastuuś
Truck soon...


Wiek: 26 Na forum: 3071 dni Posty: 799
Nick w MP: Ciastuuś
Piwa: 4297
|
|
|
|
U?ywaj znacznik?w lua.
Do tego uzupe?ni?e? dane, tak? W DBHandler pozostaje nil. Dane uzupe?niasz wsz?dzie takimi samymi jak masz podane na hostingu
|
|
|
|
|
|
|
|
| Tagi: mysql |
Anonymous


Na forum: 245 dni
Posty: 1

|
Anonymous Koniecznie zajrzyj na:
|
|
|
|