Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2016-09-10, 17:33


STOPseba

Emeryt na scenie MTA






Wiek: 25
Na forum: 3771 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5014

Respekt: 576,3
Respekt: 576,3

Witam u?ytkowniku gtao.pl potrzebuje pomocy z MYSQL mianowicie jak uzupe?niam ten kod
--[[
    ResourceOURGame v2
    DevelopersSplit <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c2015 <split.programista@gmail.com>. All rights reserved.
]]

-- Settings
DBHandler=nil
DBName="------"
DBUser="------"
DBPass="------" 
DBHost="------"

-- 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..""DBUserDBPass"share=1")
    if DBHandler then
        outputDebugString("* Connect to server MYSQL...")
    else
        outputDebugString("* No Connecting to server MYSQL..")
    end
end)


local SQL_LOGIN="------"
local SQL_PASSWD="-------"
local SQL_DB="-------"
local SQL_HOST="------"
local SQL_PORT=3306

local root getRootElement()

local SQL

local function connect()
    SQL mysql_connect(SQL_HOSTSQL_LOGINSQL_PASSWDSQL_DBSQL_PORT)
    if (not SQLthen
        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(keepAlive300000)
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 resultthen 
        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 resultthen 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 (resultthen 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 resultthen return nil end
    local tabela={}

    while true do
        local row mysql_fetch_row(result)
        if (not rowthen break end
        table.insert(tabela,row)
    end
    mysql_free_result(result)
    return tabela
end


function getSQLLink()
    return SQL
end


a potem ten skrypt pr?buje uruchomic na serwerze to wyskakuje mi taki b??d
[2016-09-10 17ERROR: [Skrypty]/ogrpg-db/s_db.lua:32dbConnect failedAccess denied for user '565153_'@'193.33.177.12' (using passwordYES)

oraz
[2016-09-10 17ERROR: [Skrypty]/ogrpg-db/s_db.lua:52attempt to call global 'mysql_connect' (a nil value)

Je?eli jeste? w stanie mi pom?c to zr?b to :)
Za pomoc :piwo:

INNE b??dy
[2016-09-10 17:35ERROR: [Skrypty]/ogrpg-db/s_db.lua:32dbConnect failedAccess denied for user '565153'@'%' to database '565153'


Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-09-10, 17:44


Pumelowsky

Amator 3D






Wiek: 23
Na forum: 4181 dni
Posty: 199
Nick w MP: Pumelowsky

Piwa: 1666

Respekt: 200,5
Respekt: 200,5Respekt: 200,5

Zamiast tego
SQL mysql_connect(SQL_HOSTSQL_LOGINSQL_PASSWDSQL_DBSQL_PORT)

wstaw to:
SQL=dbConnect("mysql""dbname="..SQL_DBNAME..";host="..SQL_HOST..""SQL_DBUSERSQL_DBPASS"share=1");


Podpis
Kontakt:

- Skype: live:pumapl_2
- GG: 56865468
- Discord: Pumelowsky#1126
- PW forum
[/center]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-09-10, 18:12


STOPseba

Emeryt na scenie MTA






Wiek: 25
Na forum: 3771 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5014

Respekt: 576,3
Respekt: 576,3

[2016-09-10 18:10:28ERROR: [Skrypty]/ogrpg-db/s_db.lua:32dbConnect failedAccess denied for user '565153'@'%' to database '565153'

[2016-09-10 18:10:28ERROR: [Skrypty]/ogrpg-db/s_db.lua:52attempt to concatenate global 'SQL_DBNAME' (a nil value)

A teraz takie co?

Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-09-10, 21:58


Emm

***** ***






Wiek: 32
Na forum: 3880 dni
Posty: 3191
Nick w MP: Emm

Piwa: 6162

Respekt: 1580
Respekt: 1580Respekt: 1580


   Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
Popraw zmienn? 'SQL_DBNAME' na poprawn?, czyli 'DBName'.

Podpis

Użytkownik: 20.10.2015r
GTAO Member: 06.03.2016r
Support-Team: 20.01.2016r
Moderator: 30.03.2016r
Mod-Team: 08.10.2016r
Vice Admin: 04.05.2018r
Administrator: 03.05.2022r


! 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.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-09-10, 22:25


STOPseba

Emeryt na scenie MTA






Wiek: 25
Na forum: 3771 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5014

Respekt: 576,3
Respekt: 576,3

tak to zrobi?em:
--[[
    ResourceOURGame v2
    DevelopersSplit <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c2015 <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..""DBUserDBPass"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_DBUSERSQL_PASSWD"share=1");
    if (not SQLthen
        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(keepAlive300000)
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 resultthen 
        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 resultthen 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 (resultthen 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 resultthen return nil end
    local tabela={}

    while true do
        local row mysql_fetch_row(result)
        if (not rowthen 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:36ERROR: [Skrypty]/ogrpg-db/s_db.lua:32dbConnect failedAccess denied for user '565153_'@'193.33.177.12' (using passwordYES)

[2016-09-10 22:24:36ERROR: [Skrypty]/ogrpg-db/s_db.lua:52dbConnect failedAccess denied for user 'root'@'193.33.177.12' (using passwordYES)


Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-09-10, 22:36


Emm

***** ***






Wiek: 32
Na forum: 3880 dni
Posty: 3191
Nick w MP: Emm

Piwa: 6162

Respekt: 1580
Respekt: 1580Respekt: 1580


   Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
--[[
    ResourceOURGame v2
    DevelopersSplit <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c2015 <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..""DBUserDBPass"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_DBUSERSQL_PASSWD"share=1");
    if (not SQLthen
        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(keepAlive300000)
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 resultthen 
        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 resultthen 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 (resultthen 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 resultthen return nil end
    local tabela={}

    while true do
        local row mysql_fetch_row(result)
        if (not rowthen break end
        table.insert(tabela,row)
    end
    mysql_free_result(result)
    return tabela
end


function getSQLLink()
    return SQL
end


Podpis

Użytkownik: 20.10.2015r
GTAO Member: 06.03.2016r
Support-Team: 20.01.2016r
Moderator: 30.03.2016r
Mod-Team: 08.10.2016r
Vice Admin: 04.05.2018r
Administrator: 03.05.2022r


! 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.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-09-10, 23:10


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

STOPseba, mo?liwe ?e nie masz praw do MySQL, dla ftp itp.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-09-10, 23:48


STOPseba

Emeryt na scenie MTA






Wiek: 25
Na forum: 3771 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5014

Respekt: 576,3
Respekt: 576,3

"Emm" napisał/a:

--[[
    ResourceOURGame v2
    DevelopersSplit <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c2015 <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..""DBUserDBPass"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_DBUSERSQL_PASSWD"share=1");
    if (not SQLthen
        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(keepAlive300000)
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 resultthen 
        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 resultthen 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 (resultthen 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 resultthen return nil end
    local tabela={}

    while true do
        local row mysql_fetch_row(result)
        if (not rowthen 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 ]
"luki123luki123" napisał/a:

STOPseba, mo?liwe ?e nie masz praw do MySQL, dla ftp itp.

Nie rozumiem.

Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-09-11, 15:06


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

STOPseba, na jakim hostingu masz MySQL ?

[ Dodano: 2016-09-11, 15:14 ]
Je?eli masz na serverProject.pl to przepisz dane takie jak s? tutaj:


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-09-11, 15:23


STOPseba

Emeryt na scenie MTA






Wiek: 25
Na forum: 3771 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5014

Respekt: 576,3
Respekt: 576,3

"luki123luki123" napisał/a:

STOPseba, na jakim hostingu masz MySQL ?

[ Dodano: 2016-09-11, 15:14 ]
Je?eli masz na serverProject.pl to przepisz dane takie jak s? tutaj:
Obrazek

MySQL tak jak i serwer mam na pukawka.pl

[ Dodano: 2016-09-11, 16:28 ]


[ Dodano: 2016-09-15, 14:45 ]
Poradzi?em sobie z tamtymi b??dami a teraz mam taki
[2016-09-15 13:09:37ERROR: [Skrypty]/ogrpg-db/s_db.lua:54dbConnect failedAccess denied for user 'root'@'193.33.177.12' (using passwordYES)


[ Dodano: 2016-09-17, 14:38 ]
Dzi?ki za pomoc.

Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Tagi: mysql
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

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
Dodaj temat do Ulubionych
Wersja do druku