#include #include #include "/usr/include/mysql/mysql.h" #include "tlmpsql.h" #include "tlmplib.h" #include "tlmpsql.m" #include "internal.h" void _F_sql_query___v1::dostart(int ) { } void _F_sql_query___v1::doend() { } void _F_sql_query___v1::empty() { } void _F_sql_query___v1::onerow(const char *[],int, NSQL_FIELD_NAMES &fields, bool &end) { } static int sql_vquery (_F_sql_query___v1 &c, NSQL &sq, const char *ctl, va_list list) { int ret = sq.vqueryf (ctl,list); if (ret != -1){ MYSQL_RES *res = sq.store_result(); int nb = mysql_num_rows(res); if (nb == 0){ c.empty(); }else if (nb > 0){ c.dostart(nb); MYSQL_FIELD *mfields= mysql_fetch_fields(res); int numf = mysql_num_fields(res); const char *tbf[numf]; for (int i=0; igetlastid(); } return ret; }