ExecuteSQLSelect

From Multi Theft Auto: Wiki
Revision as of 15:06, 23 September 2006 by IJs (talk | contribs) (GetRegistryQuery moved to ExecuteSQLSelect)
Jump to navigation Jump to search

This function retrieves one or more rows from the registry. Since the registry is powered by a SQLite database, this function automatically executes a SELECT query and returns the result as an object that can only be read by the GetRegistryResultValue and GetRegistryResultColumn functions.

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:

[sql]SELECT <fields> FROM <tables> WHERE <conditions> LIMIT <limit>

Syntax

result getRegistryValue ( string tables, string fields, [ string conditions ], [ int limit ] )

Required Arguments

  • tables: The tables you want to query. No spaces allowed. Multiple tables should be separated by a comma (,).
  • fields: The fields you want to query. No spaced allowed. Wildcard (*) allowed to query all fields in the table. Multiple fields should be separated by a comma (,).

Optional Arguments

  • conditions: The conditions for the query. Multiple conditions should be separated by logical operators (AND, OR).
  • limit: Maximum amount of rows to return.

Returns

  • r: The result-object where the results are stored in.


See Also