Scripting/Squirrel/Functions/mysql ping: 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 "This function checks if the given MySQL connection is still alive. == Syntax == <pre>mysql_ping( MySQLConnection handler )</pre> == Arguments == * ''MySQLConnetion'' '''hand...")
 
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 8: Line 8:


== Return value(s) ==
== Return value(s) ==
''int'' - ''1'' on success and/or ''0'' on failure.
''boolean'' - ''true'' on success and/or ''false'' on failure.


== Example ==
== Example ==
Line 17: Line 17:
   else //Connection is dead/not working
   else //Connection is dead/not working
     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:28, 30 January 2017

This function checks if the given MySQL connection is still alive.

Syntax

mysql_ping( MySQLConnection handler )

Arguments

  • MySQLConnetion 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.
     print("The MySQL connection is working.");
   else //Connection is dead/not working
     print("The MySQL connection is not working");
}

Related Functions