DbIsConnected: Difference between revisions
Jump to navigation
Jump to search
Automatyczna aktualizacja dokumentacji funkcji |
Complete Lua function catalog |
||
| Line 29: | Line 29: | ||
* Available only in server-side resource scripts. | * Available only in server-side resource scripts. | ||
[[Category:Lua Functions]] | |||
[[Category:Server Functions]] | [[Category:Server Functions]] | ||
[[Category:Database Functions]] | [[Category:Database Functions]] | ||
Latest revision as of 09:52, 15 August 2026
dbIsConnected
Checks whether a resource-owned database connection is still open.
Syntax
bool dbIsConnected(DatabaseConnection connection)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
connection |
DatabaseConnection |
yes | The connection to inspect. |
Returns
Returns true when the connection is valid and connected; otherwise returns false.
Examples
Verify the connection before executing a query:
if dbIsConnected(db) then
dbExec(db, "UPDATE players SET online = ?", true)
end
Notes
- Available only in server-side resource scripts.