error: cannot convert ‘std::string’ to ‘const char*’ for argument ‘2’ to ‘int mysql_query(MYSQL*, const char*)'
That says that you cannot pass a std::string
to the mysql_query(). Since it expects a const char *
, you need to use the .c_str()
method, so simply change to;
mysql_query(conn, queryText.c_str());