Skip to content

Functions

imshooter edited this page Dec 1, 2026 · 2 revisions

Every native and callback of mysql.inc, by subject. Most natives also have an open.mp name, shown on their page.

Connections

Function open.mp name Description
mysql_connect MySQL_Connect Connect to a database.
mysql_connect_file MySQL_ConnectFile Connect to a database with the settings of a file.
mysql_close MySQL_Close Close a handle after the queries it is running.
mysql_unprocessed_queries MySQL_GetUnprocessedQueries The queries of a handle that are waiting or running.
mysql_global_options MySQL_SetGlobalOption Set an option of the plugin.
mysql_init_options MySQL_CreateOptions Create a set of options for mysql_connect.
mysql_set_option MySQL_SetOption Set an option of a set.
mysql_log MySQL_SetLogLevel Choose what the plugin logs.
mysql_errno MySQL_GetErrorNumber The error of the last query of a handle given to the script, or of its connection.
mysql_error MySQL_GetError The message of the error mysql_errno gives.
mysql_set_charset MySQL_SetCharset Change the character set of a handle, for the queries sent after it.
mysql_get_charset MySQL_GetCharset The character set of a handle.
mysql_stat MySQL_GetStatus The status line of the server, waiting for the queries sent before it.
mysql_is_connected MySQL_IsConnected Whether the connection of a handle that runs ordered queries is open.
mysql_get_tls MySQL_GetTLS The TLS version and cipher of the connection of a handle that runs ordered queries.
mysql_stats MySQL_GetStats What a handle ran since it was opened.

Queries

Function open.mp name Description
mysql_escape_string MySQL_EscapeString Escape a string for a string literal.
mysql_format MySQL_Format Format a query into an array.
mysql_tquery MySQL_ThreadedQuery Send a query that runs after the queries sent before it, and call a public when it is done.
mysql_pquery MySQL_ParallelQuery Send a query that any connection of the pool runs, out of order with the rest, and call a public when it is done.
mysql_query Run a query and wait for it, after the queries sent before it.
mysql_tquery_format Format and send a query that runs after the queries sent before it, and call a public when it is done.
mysql_pquery_format Format and send a query that any connection of the pool runs, and call a public when it is done.
mysql_query_format MySQL_Query Format a query, run it and wait for it, after the queries sent before it.
mysql_send MySQL_SendQuery Format and send a query that needs no answer, after the queries sent before it.
mysql_tquery_file MySQL_ThreadedQueryFile Send the queries of a file in scriptfiles, one after another, and call a public when they are done.
mysql_query_file MySQL_QueryFile Run the queries of a file in scriptfiles and wait for them.

Cache

Function open.mp name Description
cache_get_row_count Cache_GetRowCount The rows of the active cache.
cache_get_field_count Cache_GetFieldCount The fields of the active cache.
cache_get_result_count Cache_GetResultCount The results of the active cache, one for each statement that ran.
cache_get_field_name Cache_GetFieldName The name of a field of the active cache.
cache_get_field_type Cache_GetFieldType The type of a field of the active cache.
cache_get_field_index Cache_GetFieldIndex The index of a field of the active cache.
cache_set_result Cache_SetResult Choose the result of the active cache that is read.
cache_get_value_index Cache_GetValueIndex Read a cell of the active cache as a string, by the index of its field.
cache_get_value_index_int Cache_GetValueIndexInt Read a cell of the active cache as an integer, by the index of its field.
cache_get_value_index_float Cache_GetValueIndexFloat Read a cell of the active cache as a float, by the index of its field.
cache_get_value_index_bool Cache_GetValueIndexBool Read a cell of the active cache as a bool, by the index of its field.
cache_is_value_index_null Cache_IsValueIndexNull Whether a cell of the active cache is NULL, by the index of its field.
cache_get_value_name Cache_GetValueName Read a cell of the active cache as a string, by the name of its field.
cache_get_value_name_int Cache_GetValueNameInt Read a cell of the active cache as an integer, by the name of its field.
cache_get_value_name_float Cache_GetValueNameFloat Read a cell of the active cache as a float, by the name of its field.
cache_get_value_name_bool Cache_GetValueNameBool Read a cell of the active cache as a bool, by the name of its field.
cache_is_value_name_null Cache_IsValueNameNull Whether a cell of the active cache is NULL, by the name of its field.
cache_get_row Cache_GetRow Read the fields of a row of the active cache, in order, into variables.
cache_save Cache_Save Keep the active cache after its public returns.
cache_delete Cache_Delete Free a saved cache. When it is active, no cache is active after it.
cache_set_active Cache_SetActive Make a saved cache the active one, until the public that runs returns, or until another is chosen.
cache_unset_active Cache_UnsetActive Leave no cache active.
cache_is_any_active Cache_IsAnyActive Whether a cache is active.
cache_is_valid Cache_IsValid Whether a saved cache exists.
cache_affected_rows Cache_GetAffectedRows The rows the query of the active cache changed.
cache_insert_id Cache_GetInsertID The value an AUTO_INCREMENT column took in the query of the active cache.
cache_warning_count Cache_GetWarningCount The warnings the query of the active cache raised.
cache_get_query_exec_time Cache_GetQueryExecutionTime The time the query of the active cache took to run.
cache_get_query_string Cache_GetQueryString The text of the query of the active cache.
cache_get_errno Cache_GetErrorNumber The error of the query of the active cache, as inside the public of a failed query on a handle with ERROR_CALLBACK.

JSON cells

Function open.mp name Description
cache_get_json_type Cache_GetJSONType The type of a value inside a JSON cell of the active cache.
cache_get_json_count Cache_GetJSONCount The members of an object or the items of an array inside a JSON cell of the active cache.
cache_get_json_key Cache_GetJSONKey The name of a member of an object inside a JSON cell of the active cache, by its position.
cache_get_json_value Cache_GetJSONValue Read a value inside a JSON cell of the active cache as a string. Objects and arrays read as their JSON.
cache_get_json_int Cache_GetJSONInt Read a value inside a JSON cell of the active cache as an integer.
cache_get_json_float Cache_GetJSONFloat Read a value inside a JSON cell of the active cache as a float.
cache_get_json_bool Cache_GetJSONBool Read a value inside a JSON cell of the active cache as a bool.

ORM

Function open.mp name Description
orm_create ORM_Create Create an ORM, a row of a table mapped to variables of the script.
orm_destroy ORM_Destroy Destroy an ORM.
orm_errno ORM_GetError The outcome of the last orm_select of an ORM.
orm_apply_cache ORM_ApplyCache Write a row of the active cache into the variables of an ORM, the key included, by the names of their fields.
orm_select ORM_Load Read the row with the key of an ORM into its variables, then call a public.
orm_update ORM_Update Write the variables of an ORM into the row with its key, then call a public.
orm_insert ORM_Insert Insert the variables of an ORM as a new row, set an integer key to the new AUTO_INCREMENT value, then call a public.
orm_delete ORM_Delete Delete the row with the key of an ORM, then call a public.
orm_load Read the row with the key of an ORM into its variables, as orm_select does.
orm_save ORM_Save Update the row of an ORM when its key is set, or insert one when the key is 0 or empty, then call a public.
orm_addvar_int ORM_AddVariableInt Map an integer variable to a field of an ORM.
orm_addvar_float ORM_AddVariableFloat Map a float variable to a field of an ORM.
orm_addvar_string ORM_AddVariableString Map a string variable to a field of an ORM.
orm_clear_vars ORM_ClearVariables Set every variable of an ORM, the key included, to 0 or an empty string.
orm_delvar ORM_RemoveVariable Forget the variable of a field of an ORM.
orm_setkey ORM_SetKey Make the variable of a field the key of an ORM. A key set before goes back to the variables.

Queries built in pieces

Function open.mp name Description
mysql_builder_create MySQL_CreateBuilder Start a query built a piece at a time.
mysql_builder_append MySQL_AppendBuilder Add a piece to a built query.
mysql_builder_trim MySQL_TrimBuilder Remove characters from the end of a built query, as the last comma of a list.
mysql_builder_length MySQL_GetBuilderLength The length of a built query.
mysql_builder_clear MySQL_ClearBuilder Empty a built query to build another with the same builder.
mysql_builder_destroy MySQL_DestroyBuilder Forget a built query without sending it.
mysql_builder_tquery MySQL_ThreadedQueryBuilder Send a built query after the queries sent before it, call a public when it is done, and forget the builder.
mysql_builder_pquery MySQL_ParallelQueryBuilder Send a built query that any connection of the pool runs, call a public when it is done, and forget the builder.
mysql_builder_query MySQL_QueryBuilder Run a built query and wait for it, as mysql_query does, and forget the builder.

Prepared statements

Function open.mp name Description
mysql_stmt_prepare MySQL_PrepareStatement Prepare a statement, with a specifier for each value.
mysql_stmt_execute MySQL_ExecuteStatement Run a statement once, after the queries sent before it, and call a public when it is done.
mysql_stmt_query MySQL_QueryStatement Run a statement once and wait for it, as mysql_query does.
mysql_stmt_close MySQL_CloseStatement Close a statement after what was sent before it, and forget its batches.

Batches

Function open.mp name Description
mysql_batch_create MySQL_CreateBatch Start a batch of rows for a statement.
mysql_batch_add_row MySQL_AddBatchRow Add a row of values to a batch. The values are copied at once.
mysql_batch_rows MySQL_GetBatchRows The rows added to a batch.
mysql_batch_execute MySQL_ExecuteBatch Send the rows of a batch after the queries sent before it, call a public when they are done, and forget the batch.
mysql_batch_query MySQL_QueryBatch Send the rows of a batch and wait for them, as mysql_query does, and forget the batch.
mysql_batch_destroy MySQL_DestroyBatch Forget a batch without sending it.

Transactions

Function open.mp name Description
mysql_transaction_create MySQL_CreateTransaction Start a transaction, queries and statements that apply all together or not at all.
mysql_transaction_add MySQL_AddTransactionQuery Add a query to a transaction.
mysql_transaction_add_stmt MySQL_AddTransactionStatement Add a run of a statement to a transaction.
mysql_transaction_steps MySQL_GetTransactionSteps The queries and statements added to a transaction.
mysql_transaction_execute MySQL_ExecuteTransaction Run a transaction after the queries sent before it, call a public when it is done, and forget it.
mysql_transaction_query MySQL_QueryTransaction Run a transaction and wait for it, as mysql_query does, and forget it.
mysql_transaction_destroy MySQL_DestroyTransaction Forget a transaction without running it.

Passwords

Function open.mp name Description
mysql_hash_argon2 MySQL_HashArgon2 Hash a password with Argon2id on a thread of the plugin, and call a public with the hash.
mysql_hash_bcrypt MySQL_HashBcrypt Hash a password with bcrypt, as $2b$, on a thread of the plugin, and call a public with the hash.
mysql_verify_password MySQL_VerifyPassword Verify a password against an Argon2 or bcrypt hash on a thread of the plugin, and call a public with whether they match.
mysql_argon2_costs MySQL_SetArgon2Costs Set the costs of the Argon2id hashes started after it.
mysql_bcrypt_cost MySQL_SetBcryptCost Set the cost of the bcrypt hashes started after it.

Callbacks

Function open.mp name Description
OnQueryError A query failed. Its public is not called, unless its handle has ERROR_CALLBACK.

Home

Guides

Reference

Functions

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

Clone this wiki locally