ExecuteSQLInsert

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

This function adds a row in the registry. Since the registry is powered by a SQLite database, this function automatically executes an INSERT query with the appropriate parameters. This function can be used to add rows into the database that can later be modified by using the setRegistryQuery function.

The registry is stored globally and can be read from and written to by all scripts in sessions. This is useful if you want to store data for your script.

The actual SQL query that is executed will be the following:

INSERT INTO <table> VALUES <values>

Syntax

bool addRegistryQuery ( string table, string values )

Required Arguments

  • table: The table you want to modify.
  • values: The values that need to be inserted for each field in the table. The default SQL syntax is used, which means that the = is used to set a value, the ' is used to indicate a value and the , is used as a delimiter for multiple values (e.g. field1 = 'testA', field2 = 'testB' as values). Field names are optional. If you don't use field names, the table's order of fields is used (e.g. testA,testB as values).

Returns

The function returns a boolean which is true on success, and false on failure.

See Also