Scripting/Squirrel/Functions/mysql query

From Vice City Multiplayer
Revision as of 18:24, 30 January 2017 by Thijn (talk | contribs)
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 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.

Related Functions

Template:Scripting/Squirrel/Functions/Mysql