Modules/MySQL/MysqlDestroy: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
==Description==
{{ModuleFunction|MySQL}}
This functions closes the MySQL connection that is currently opened, if there is one.


This function is provided by the '''ml_mysql''' module.
This functions destroys a mysql object (gracefully), and cleans up any data it used.


==Syntax==
==Syntax==
nil mysqlClose ( [[mysql]] object )
<syntaxhighlight lang="lua">nil mysqlClose ( mysql mysqlobj )</syntaxhighlight>


===Required Arguments===
===Required Arguments===
*'''mysql''' : The [[mysql]] object created by [[mysqlOpen]]
*'''mysqlobj''' : The [[mysql]] object created by [[Modules/MySQL/MysqlCreate|mysqlCreate]]


===Optional Arguments===
===Optional Arguments===


''None''
''None''
==Example==
function onMySQLOpen ( my_mysql, result )
  if ( result )
    -- do something useful.
    mysqlClose ( my_mysql );
  else
    -- panic.
  end
end
<...>
mysqlOpen ( "onMySQLOpen", "localhost", "user123", "mypassword", "testdatabase", 3306 );

Latest revision as of 20:49, 29 September 2009


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


This functions destroys a mysql object (gracefully), and cleans up any data it used.

Syntax

nil mysqlClose ( mysql mysqlobj )

Required Arguments

Optional Arguments

None