mysql_query — performs a query on the database

int mysql_query(MYSQL * mysql,
                const char * query);

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.

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.

Return value

Zero on success, non zero on failure

[Note]

For executing multi statements the statements within the null terminated string statements must be separated by a semicolon.

If your statement contains binary data you should use mysql_real_query or escape your data with mysql_hex_string()

To determine if a statement returned a result set use the function mysql_num_fields().

See also

mysql_real_query(), mysql_num_fields(), mysql_hex_string(), mysql_use_result() mysql_store_result()