Имеем Server MySQL v 3.23.47
Используя mysql.h делаем запрос к БД:
* * *
if (mysql_query(mysql_ptr,query)) {
printf("ERROR 1");
}
else {
printf("OK 1");
}
if (!(res = mysql_store_result(mysql_ptr))) {
printf("ERROR 2");
}
else {
printf("OK 2");
}