Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local connection = nil
- addEventHandler("onResourceStart", resourceRoot,
- function(resource)
- connection = dbConnect("mysql", "dbname=ig_gaming;host=localhost;port=3306;","root","martinka02")
- if connection then
- outputDebugString(getResourceName(resource).." : Csatlakozott az adatbázishoz!")
- return true
- else
- outputDebugString(getResourceName(resource).." : Nem tudodd csatlakozni az adatbázishoz!")
- return false
- end
- end
- )
- function _Query( ... )
- if connection then
- local query = dbQuery(connection, ... )
- local result = dbPoll(query, -1)
- return result
- else
- return false
- end
- end
- function _QuerySingle(str,...)
- if connection then
- local result = _Query(str,...)
- if type(result) == 'table' then
- return result[1]
- end
- else
- return false
- end
- end
- function _Exec(str,...)
- if connection then
- local query = dbExec(connection, str,...)
- return query
- else
- return false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement