! Koniecznie zapoznaj się z regulaminem forum.
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również regulaminy działów, w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez Administrację, przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w tym dziale.
Najważniejsze informacje od Administracji możesz przeczytać tutaj oraz tutaj.
--[[
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="565153_"
DBUser="565153_"
DBPass="-------"
DBHost="sql.pukawka.pl"
-- Functions
function dbSet(...)
if not {...} then return end
local query=dbExec(DBHandler, ...)
return query
end
function dbGet(...)
if not {...} then return end
--outputDebugString(tostring(...))
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="565153_"
local SQL_PASSWD="------"
local SQL_DB="565153_"
local SQL_HOST="sql.pukawka.pl"
local SQL_PORT=3306
local root = getRootElement()
local SQL
local function connect()
SQL=dbConnect("mysql", "dbname="..DBName..";host="..SQL_HOST.."", SQL_DBUSER, SQL_PASSWD, "share=1");
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)
outputDebugString(tostring(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)
outputDebugString(tostring(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)
outputDebugString(tostring(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
i mam takie b??dy:
[2016-09-10 22:24:36] ERROR: [Skrypty]/ogrpg-db/s_db.lua:32: dbConnect failed; Access denied for user '565153_'@'193.33.177.12' (using password: YES)
[2016-09-10 22:24:36] ERROR: [Skrypty]/ogrpg-db/s_db.lua:52: dbConnect failed; Access denied for user 'root'@'193.33.177.12' (using password: YES)
--[[
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="565153_"
DBUser="565153_"
DBPass="-------"
DBHost="sql.pukawka.pl"
-- Functions
function dbSet(...)
if not {...} then return end
local query=dbExec(DBHandler, ...)
return query
end
function dbGet(...)
if not {...} then return end
--outputDebugString(tostring(...))
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="565153_"
local SQL_PASSWD="------"
local SQL_DB="565153_"
local SQL_HOST="sql.pukawka.pl"
local SQL_PORT=3306
local root = getRootElement()
local SQL
local function connect()
SQL=dbConnect("mysql", "dbname="..SQL_DB..";host="..SQL_HOST.."", SQL_DBUSER, SQL_PASSWD, "share=1");
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)
outputDebugString(tostring(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)
outputDebugString(tostring(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)
outputDebugString(tostring(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
! Koniecznie zapoznaj się z regulaminem forum.
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również regulaminy działów, w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez Administrację, przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w tym dziale.
Najważniejsze informacje od Administracji możesz przeczytać tutaj oraz tutaj.
--[[
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="565153_"
DBUser="565153_"
DBPass="-------"
DBHost="sql.pukawka.pl"
-- Functions
function dbSet(...)
if not {...} then return end
local query=dbExec(DBHandler, ...)
return query
end
function dbGet(...)
if not {...} then return end
--outputDebugString(tostring(...))
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="565153_"
local SQL_PASSWD="------"
local SQL_DB="565153_"
local SQL_HOST="sql.pukawka.pl"
local SQL_PORT=3306
local root = getRootElement()
local SQL
local function connect()
SQL=dbConnect("mysql", "dbname="..SQL_DB..";host="..SQL_HOST.."", SQL_DBUSER, SQL_PASSWD, "share=1");
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)
outputDebugString(tostring(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)
outputDebugString(tostring(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)
outputDebugString(tostring(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
Dalej to samo
[ Dodano: 2016-09-10, 23:53 ]
STOPseba, mo?liwe ?e nie masz praw do MySQL, dla ftp itp.
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach