Scripting/Squirrel/Functions/mysql query: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "This function will execute a query from the MySQL database. == Syntax == <pre>mysql_query( database, query);</pre> == Arguments == * ''string'' '''database''' - The databa...") |
No edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 7: | Line 7: | ||
== Arguments == | == Arguments == | ||
* | * '''database''' - The database on which the query shall be executed. | ||
* | * '''query''' - The query to be executed. | ||
== Example == | == Example == | ||
Line 23: | Line 23: | ||
You can also use this function to SELECT, DELETE, INSERT etc. | You can also use this function to SELECT, DELETE, INSERT etc. | ||
== Related Functions == | |||
{{Scripting/Squirrel/Functions/MySQL Functions}} | |||
[[Category:Scripting/Squirrel/Functions/Mysql_Functions]] |
Latest revision as of 18:28, 30 January 2017
This function will execute a query from the MySQL database.
Syntax
mysql_query( database, query);
Arguments
- database - The database on which the query shall be executed.
- query - The query to be executed.
Example
function onPlayerCommand(player, command, arguments)
{
if (command=="resetcash")
{
mysql_query( vcmpdb, "UPDATE accounts SET cash = '0' WHERE name = '"+player.Name+"'");
}
}
Notes
You can also use this function to SELECT, DELETE, INSERT etc.