Wysłany: 2016-07-13, 13:18
NeroNix
Wiek: 27 Na forum: 3614 dni Posty: 69
Piwa : 1
Mam problem z DB. Wywala mi takie b??dy i to jest chyba przyczyn?, ?e nie czyta wszystkiego w Mysql.
B??d 1:
ERROR : [ skrypty_glowne ]/ ogrpg - db / s_db . lua81 : attempt to call global 'mysql_query' < a nil value >
80. function pobierzTabeleWynikow ( query )
81. local result = mysql_query ( SQL , query )
82. if ( not result ) then
83. outputDebugString ( "mysql_query failed: (" .. mysql_errno ( SQL ) .. ") " .. mysql_error ( SQL ))
84. outputServerLog ( "mysql_query failed: (" .. mysql_errno ( SQL ) .. ") " .. mysql_error ( SQL ))
85. return nil
86. end
87. local tabela ={}
88. for result , row in mysql_rows_assoc ( result ) do
89. table . insert ( tabela , row )
90. end
91. mysql_free_result ( result )
92. return tabela
end
Drugi B??d
ERROR : [ skrypty_glowne ]/ ogrpg - offices / selectjobs / s_selectjob . lua : 27 : call failet to call 'ogrpg-db:pobierzTabeleWynikow' [ string "?" ]
26.setTimer (function()
27. local result = exports [ "ogrpg-db" ]: pobierzTabeleWynikow ( "SELECT * FROM ogrpg_jobs" )
if ( result ) then
for ii , vv in ipairs ( result ) do
if vv [ "code" ] ~= "SAPD" then
if vv [ "actived" ] ~= getyesterday () and vv [ "actived" ] ~= getday () then
local query = string . format ( "SELECT * FROM ogrpg_office WHERE code=%q" , vv [ "code" ])
local result2 = exports [ "ogrpg-db" ]: pobierzWyniki ( query )
if ( result2 ) then
local query2 = string . format ( "UPDATE ogrpg_office SET spaces=%d WHERE code=%q" , result2 [ "spaces" ]- 1 , vv [ "code" ])
exports [ "ogrpg-db" ]: dbSet ( query2 )
-- local query2 = string . format ( "UPDATE ogrpg_office SET spaces=%d WHERE code=%q" , result2 [ "spaces" ]+ 1 , vv [ "code" ])
-- exports [ "ogrpg-db" ]: dbSet ( query2 )
local query3 = string . format ( "DELETE FROM ogrpg_jobs WHERE code=%q AND uid=%d AND actived=%q LIMIT 1;" , vv [ "code" ], vv [ "uid" ], vv [ "actived" ])
exports [ "ogrpg-db" ]: dbSet ( query3 )
outputDebugString ( "Wyczyszczono prace!" )
end
end
end
end
end
--[[if #result > 0 then
outputServerLog ( tostring ( result . actived ))
for key , resulte in pairs ( result ) do
outputServerLog ( "INFO 2:" .. tostring ( resulte . actived ))
if resulte . code ~= "SAPD" then
if resulte . actived ~= getyesterday and resulte . actived ~= getday then
local result2 = exports [ "ogrpg-db" ]: dbGet ( "SELECT * FROM ogrpg_office WHERE code=?" , resulte . code )
if #result2 > 0 then
exports [ "ogrpg-db" ]: dbSet ( "UPDATE ogrpg_office SET spaces=spaces+1 WHERE code=?" , result2 . spaces , result2 . code )
exports [ "ogrpg-db" ]: dbSet ( "DELETE FROM ogrpg_jobs WHERE code=? AND uid=? AND actived=?<NOW()" , resulte . code , resulte . uid , resulte . actived )
outputDebugString ( "Wyczyszczono prace!" )
outputServerLog ( "Wyczyszczono prace!" )
end
end
end
end
--]] -- end
end , 15000 , 0 ) -- 86400000 24h 86400000
Trzeci B??d:
ERROR : [ skrypty_glowne ]/ ogrpg - core / vehicles . lua : 94 : call : failet to call 'ogrpg-db:pobierzWyniki' [ string "?"
Czwarty B??d:
ERROR : [ skrypty_glowne ]/ ogrpg - core / saveplayers . lua : 26 : call : failed to call 'ogrpg-db:pobierzWyniki' [ string "?" ]
Prosz? poratujcie ! Oczywi?cie Respekt i Piwko!!!!!!!!!
Wysłany: 2016-07-13, 13:23
AteX
Wiek: 26 Na forum: 4015 dni Posty: 927
Nick w MP: #AteX
Piwa : 8360
Nie posiadasz pewnie modu?u mysql, lecz on i tak jest przestarza?y. Polecam funkcje z mysql zamieni? na:
Więcej informacji znajdziesz w Wikipedii MTA: dbConnect
Więcej informacji znajdziesz w Wikipedii MTA: dbExec
Więcej informacji znajdziesz w Wikipedii MTA: dbQuery
A jak chcesz modu? to jest do pobrania st?d: https://wiki.multitheftauto.com/wiki/Mysql
Wysłany: 2016-07-13, 13:31
NeroNix
Wiek: 27 Na forum: 3614 dni Posty: 69
Piwa : 1
AteX ,
Nie wiem jak to zrobi? nie siedz? w Mysql m?g?by? mi pokaza? na przyk?adzie jak mam to robi??
80. function pobierzTabeleWynikow ( query )
81. local result = mysql_query ( SQL , query )
82. if ( not result ) then
83. outputDebugString ( "mysql_query failed: (" .. mysql_errno ( SQL ) .. ") " .. mysql_error ( SQL ))
84. outputServerLog ( "mysql_query failed: (" .. mysql_errno ( SQL ) .. ") " .. mysql_error ( SQL ))
85. return nil
86. end
87. local tabela ={}
88. for result , row in mysql_rows_assoc ( result ) do
89. table . insert ( tabela , row )
90. end
91. mysql_free_result ( result )
92. return tabela
end
Wysłany: 2016-07-13, 13:44
AteX
Wiek: 26 Na forum: 4015 dni Posty: 927
Nick w MP: #AteX
Piwa : 8360
Przyk?ady s? na wiki... Wystarczy znajomo?? angielskiego oraz ch?ci do nauki, a nie samego CTRL+C CTRL+V.
local q = dbQuery ( SQL , "SELECT * FROM nazwa_tabeli" )
local result = dbPoll ( q , - 1 )
Wysłany: 2016-07-13, 16:04
NeroNix
Wiek: 27 Na forum: 3614 dni Posty: 69
Piwa : 1
AteX , No okej , a jak wgra? te modu?y mysql ? ?eby wsp??pracowa?o to wszystko?
Bo pobra?em na wersj? 64 bitow? i doda?em do mtaconfig to
< module src = "mta_mysql.dll" />
I nadal nic
Wysłany: 2016-07-13, 16:26
Damian_
Skrypter
Wiek: 29 Na forum: 3753 dni Posty: 66
Nick w MP: Damian
Piwa : 3678
musisz stworzy? folder modules dodaj tam i w mta conf nadaj prawa
Podpis
Projekt serwera : ourStory
Adres Forum :
www.our-story.pl
Rejestruj się już dziś !
FAQ: Potrzebujesz pomocy w kodowaniu LUA,PHP ? Pisz śmiało postaram się pomóc .
Pomagam tworzyć strony internetowe ! Potrzebujesz? Pisz
Wysłany: 2016-07-13, 16:37
NeroNix
Wiek: 27 Na forum: 3614 dni Posty: 69
Piwa : 1
Damian_ ,
Ju? to zrobi?em. Nadal nic
Tagi: adventure :: rpg
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: