msqlQuery(3)

NAME
msqlQuery - Send a SQL query to the engine

SYNOPSYS
#include <msql.h>

int msqlQuery(int sock, char *query);

DESCRIPTION
Queries are sent to the engine over the connection associated with sock as plain text strings using msqlQuery(). If the query generates output from the engine, such as a SELECT statement, the data is buffered in the API waiting for the application to retrieve it. If the application submits another query before it retrieves the data using msqlStoreResult(3), the buffer will be overwritten by any data generated by the new query.

RETURN VALUE
On success a value of 0 is returned. If an error occurs, a value of -1 is returned and the variable msqlErrmsg contains an appropriate text message. This variable is defined in <msql.h>.

SEE ALSO
msqlConnect(3), msqlSelectDB(3), msqlStoreResult(3), msqlClose(3), msqld(8), msql(5).