Scripting/Squirrel/Functions/mysql ping: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
mNo edit summary |
No edit summary |
||
| Line 8: | Line 8: | ||
== Return value(s) == | == Return value(s) == | ||
'' | ''boolean'' - ''true'' on success and/or ''false'' on failure. | ||
== Example == | == Example == | ||
| Line 19: | Line 19: | ||
} | } | ||
</pre> | </pre> | ||
By KAKAN | |||
Revision as of 15:08, 4 March 2016
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");
}
By KAKAN