Scripting/Squirrel/Functions/mysql close: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "Closes an established connection to a MySQL server. == Syntax == mysql_close ( MySQLConnection handler ) == Arguments == * ''MySQLConnection'' '''handler''' - A valid MySQL...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 18: Line 18:
     print("The MySQL connection is not working");
     print("The MySQL connection is not working");
}</pre>
}</pre>
== Related Functions ==
{{Scripting/Squirrel/Functions/MySQL Functions}}
[[Category:Scripting/Squirrel/Functions/Mysql_Functions]]

Latest revision as of 18:27, 30 January 2017

Closes an established connection to a MySQL server.

Syntax

mysql_close ( MySQLConnection handler )

Arguments

  • MySQLConnection handler - A valid MySQL link/handler

Return value(s)

  • boolean - true on success and/or false on failure

Example

function onScriptLoad(){
   local handler = mysql_connect("localhost","root","password","database");
   if( mysql_ping( handler ) == 1 ) //Connection is alive.
     mysql_close( handler );
   else //Connection is dead/not working
     print("The MySQL connection is not working");
}

Related Functions