mysql_query
mysql_query sends a null-terminated SQL string to the MariaDB server for execution, returning zero on success; use mysql_real_query for binary-safe operation.
Syntax
int mysql_query(MYSQL * mysql,
const char * query);Parameters
mysql- a mysql handle, which was previously allocated by mysql_init() or mysql_real_connect().query-a null terminated string containing the statement to be performed.
Description
Performs a statement pointed to by the null terminate string query against the database. Contrary to mysql_real_query(), mysql_query() is not binary safe.
Return Value
Returns zero on success, non zero on failure
See Also
This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

