Modules/MySQL/MysqlDestroy: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 6: Line 6:


==Syntax==
==Syntax==
  bool mysqlClose ()
  bool mysqlClose ( [[mysql]] object )


===Required Arguments===
===Required Arguments===
 
*'''mysql''' : The [[mysql]] object created by [[mysqlOpen]]
''None''


===Optional Arguments===
===Optional Arguments===
Line 17: Line 16:


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

Revision as of 11:58, 22 April 2006

Description

This functions closes the MySQL connection that is currently opened, if there is one.

This function is provided by the ml_mysql module.

Syntax

bool mysqlClose ( mysql object )

Required Arguments

Optional Arguments

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 );