Scripting/Squirrel/Functions/mysql ping

From Vice City Multiplayer
Revision as of 14:57, 4 March 2016 by KAKAN (talk | contribs) (Created page with "This function checks if the given MySQL connection is still alive. == Syntax == <pre>mysql_ping( MySQLConnection handler )</pre> == Arguments == * ''MySQLConnetion'' '''hand...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing

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)

int - 1 on success and/or 0 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");