Wysłany: 2017-01-16, 20:15
Vintage
Wiek: 23 Na forum: 3555 dni Posty: 64
Piwa : 1
Wysłany: 2017-01-16, 20:26
_Haze
Peace Yo!
Wiek: 24 Na forum: 4184 dni Posty: 1648
Nick w MP: Haze
Piwa : 2628
HerbatnikTv , nie istnieje taka funkcja jak mysql_connect tylko
Więcej informacji znajdziesz w Wikipedii MTA: dbConnect
Więcej informacji znajdziesz w Wikipedii MTA: dbExec
Więcej informacji znajdziesz w Wikipedii MTA: dbQuery
Więcej informacji znajdziesz w Wikipedii MTA: dbPoll
(zamie? mysql_connect na dbConnect, mysql_query na dbQuery i reszte)
http://www.gtao.pl/poradn...te-vt102403.htm tutaj masz bardziej szczeg??owo opisane
Wysłany: 2017-01-16, 20:47
Vintage
Wiek: 23 Na forum: 3555 dni Posty: 64
Piwa : 1
tak mam --[[
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 = "db_4277"
DBUser = "db_92877"
DBPass = "1xrgwewe"
DBHost = "94.23.90.14"
-- 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 = "d2vddfh77"
local SQL_PASSWD = "1xgfds5z6"
local SQL_DB = "db2377"
local SQL_HOST = "94.2523re.14"
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 )
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
[ Dodano : 2017-01-16, 20:48 ]
Hazmudex ,
Wysłany: 2017-01-16, 21:05
_Haze
Peace Yo!
Wiek: 24 Na forum: 4184 dni Posty: 1648
Nick w MP: Haze
Piwa : 2628
HerbatnikTv , to 2 mo?esz usun??
Wysłany: 2017-01-16, 21:24
Vintage
Wiek: 23 Na forum: 3555 dni Posty: 64
Piwa : 1
Hazmudex ,
???? SQL ?=? mysql_connect ( SQL_HOST ,? SQL_LOGIN ,? SQL_PASSWD ,? SQL_DB ,? SQL_PORT )
Czy to>??????????????
local ? SQL_LOGIN = "d2vddfh77"
local ? SQL_PASSWD = "1xgfds5z6"
local ? SQL_DB = "db2377"
local ? SQL_HOST = "94.2523re.14"
local ? SQL_PORT = 3306
Wysłany: 2017-01-17, 11:02
mixLoLmix2
Programista
Wiek: 35 Na forum: 4113 dni Posty: 454
Nick w MP: TomeQmix
Piwa : 1915
Tu masz b??d:
local SQL_LOGIN = "d2vddfh77"
local SQL_PASSWD = "1xgfds5z6"
local SQL_DB = "db2377"
local SQL_HOST = "94.2523re.14"
local SQL_PORT = 3306
local SQL_LOGIN = "d2vddfh77"
local SQL_DB = "db2377"
Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106
Wysłany: 2017-01-17, 15:12
Vintage
Wiek: 23 Na forum: 3555 dni Posty: 64
Piwa : 1
mixLoLmix2 , ja tu mam uzupe?nonione tylko wpisa?em inne
[ Dodano : 2017-01-17, 15:19 ]
HerbatnikTv , nadal b??d
Tagi: mysql
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: