Puoi usare le API C MySQL per connetterti ed eseguire una query.
MYSQL mysql;
mysql_init(&mysql);
mysql_real_connect(&mysql, "localhost", "root", "pwd", "db", 0, NULL, 0);
mysql_query(&mysql, "INSERT INTO userdetails VALUES ('1','nome','pwd','domanda','telefono')");
mysql_close(&mysql);In produzione usa prepared statement per evitare SQL injection.