#include #include int main() { MYSQL conn; int r; MYSQL_RES *res; mysql_init(&conn); mysql_real_connect(&conn, "127.0.0.1", "root", "", "test", 3306, NULL, CLIENT_MULTI_RESULTS); r = mysql_query(&conn, "set names utf8"); printf("ret=%d\n", r); r = mysql_query(&conn, "select version()"); printf("ret=%d\n", r); res = mysql_store_result(&conn); printf("res=%d\n", res); r = mysql_query(&conn, "DROP FUNCTION IF EXISTS функцийка"); printf("ret=%d\n", r); r = mysql_query(&conn, "CREATE FUNCTION функцийка( параметър_версия VARCHAR(25)) RETURNS VARCHAR(25) DETERMINISTIC RETURN параметър_версия"); printf("ret=%d\n", r); r = mysql_query(&conn, "SELECT функцийка(VERSION())"); printf("ret=%d\n", r); res = mysql_store_result(&conn); printf("res=%d\n", res); printf("Done!\n"); }