dbExec | Multi Theft Auto: Wiki Skip to content

dbExec

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function executes a database query using the supplied connection. No query result is returned.

Tip

The server command debugdb 2 will output verbose information on each query to a logging file (usually logs/db.log )

OOP Syntax Help! I don't understand this!

Syntax

bool dbExec ( element databaseConnection, string query, var param1 [, var param2 ...] )
Required Arguments
  • databaseConnection: A database connection element previously returned from dbConnect
  • query: An SQL query. Positions where parameter values will be inserted are marked with a ?
  • param1 [, var param2 ...]: MISSING_PARAM_DESC

Returns

  • bool: value

Returns true unless the connection is incorrect, in which case it returns false .

Code Examples

shared

This example executes an INSERT query:

dbExec( connection, "INSERT INTO table_name VALUES (?,?,?)", "aaa", "bbb", 10 )