Modules/MTA-MySQL/mysql close: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
Line 27: Line 27:
==See also==
==See also==
{{Modules/MTA-MySQL/Handler_functions}}
{{Modules/MTA-MySQL/Handler_functions}}
[[RU:Modules/MTA-MySQL/mysql_close]]

Latest revision as of 14:45, 2 December 2017


Package-x-generic.png This function is provided by the external module MTA-MySQL. You must install this module to use this function.

Closes an established connection to a MySQL server.

Syntax

mysql_close ( MySQLConnection handler )

Required arguments

  • handler: A valid MySQL link

Returns

This function doesn't return any value

Example

Example 1: This example makes a MySQL connection and then closes it

handler = mysql_connect("localhost", "username", "password", "mta_users") -- Establish the connection
if ( not handler ) then -- The connection failed
  outputDebugString("Unable to connect to the MySQL server")
else
  mysql_close(handler) -- Close the connection
end

See also