Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- connection functions
- local function connect( )
- local user = "BLA_server"
- local password = "BLA"
- connection = dbConnect ( "MySQL", "dbname=BLA_server;host=159.253.0.5;port=3306", user, password )
- if connection then
- return true
- else
- outputDebugString ( "Connection with the MySQL database failed", 1 )
- return false
- end
- end
- local function query( str, ... )
- if ( ... ) then
- local t = { ... }
- for k, v in ipairs( t ) do
- t[ k ] = escape_string( tostring( v ) ) or ""
- end
- str = str:format( unpack( t ) )
- end
- local result = dbQuery( connection, str )
- if result then
- for num = 1, max_results do
- if not results[ num ] then
- results[ num ] = { r = result, q = str }
- return num
- end
- end
- dbQuery( result )
- return false
- end
- return false
- end
Add Comment
Please, Sign In to add comment