1mysql_query(3) MariaDB Connector/C mysql_query(3)
2
3
4
5 Name
6 mysql_query - executes a null terminated statement string
7
8 Synopsis
9 #include <mysql.h>
10
11 int mysql_query(MYSQL * mysql,
12 const char * query);
13
14 Description
15 Performs a statement pointed to by the null terminate string query
16 against the database. Contrary to mysql_real_query(3), mysql_query()
17 is not binary safe.
18
19 Parameter
20 • mysql - a mysql handle, which was previously allocated by
21 mysql_init(3) and connected by mysql_real_connect(3).
22
23 • query -a null terminated string containing the statement to be per‐
24 formed.
25
26 Notes
27 • For executing multi statements the statements within the null termi‐
28 nated string statements must be separated by a semicolon.
29
30 • If your statement contains binary data you should use mysql_re‐
31 al_query(3) or escape your data with mysql_hex_string(3).
32
33 • To determine if a statement returned a result set use the function
34 mysql_field_count(3).
35
36 Return value
37 Returns zero on success, non zero on failure.
38
39 See also
40 • mysql_real_query(3)
41
42 • mysql_field_count(3)
43
44 • mysql_hex_string(3)
45
46 • mysql_use_result(3)
47
48 • mysql_store_result(3)
49
50
51
52Version 3.3.1 mysql_query(3)