Skip to content

mysql_stmt_prepare

imshooter edited this page Dec 1, 2026 · 2 revisions

Prepare a statement, with a specifier for each value.

It is sent to the server once and then run with values that are never escaped or parsed again. %i, %d and %x take an integer, %u an unsigned one, %f a float, %s, %e, %q and %j a string, bound as it is, and %Q the text of a builder. It runs on the connection of the handle that runs ordered queries, and is prepared again when the connection is lost or the tables change.

native Statement:mysql_stmt_prepare(MySQL:handle, const query[]);

With open.mp names, from the same include:

native Statement:MySQL_PrepareStatement(MySQL:handle, const query[]);

Parameters

Parameter Description
MySQL:handle Handle to run it through.
const query[] The statement, as INSERT INTO items (uuid, slot) VALUES (%q, %i).

Returns

  • The statement.
  • MYSQL_INVALID_STATEMENT when the handle does not exist, or a specifier is not valid.

Home

Guides

Reference

Functions

Connections
Queries
Cache
JSON cells
ORM
Queries built in pieces
Prepared statements
Batches
Transactions
Passwords
Callbacks

Clone this wiki locally