X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2FmysqlConn.c;h=d2430f0889d0ec772dd1d15f236a655e0b266e22;hb=989cb8324ec8fe9caba511d89051552638dbc776;hp=75bb4269a92528d496d7b6e8b50740ce517eb571;hpb=bb5692b9cbff069abbf9573c81e86c3cd2061ceb;p=NeonServV5.git diff --git a/src/mysqlConn.c b/src/mysqlConn.c index 75bb426..d2430f0 100644 --- a/src/mysqlConn.c +++ b/src/mysqlConn.c @@ -203,6 +203,25 @@ void printf_mysql_query(const char *text, ...) { } } +void printf_long_mysql_query(int len, const char *text, ...) { + va_list arg_list; + char queryBuf[len]; + int pos; + queryBuf[0] = '\0'; + va_start(arg_list, text); + pos = vsnprintf(queryBuf, len - 2, text, arg_list); + va_end(arg_list); + if (pos < 0 || pos > (len - 2)) pos = len - 2; + queryBuf[pos] = '\0'; + printf("MySQL: %s\n", queryBuf); + if(mysql_query(mysql_conn, queryBuf)) { + check_mysql(); + if(mysql_query(mysql_conn, queryBuf)) { + show_mysql_error(); + } + } +} + char* escape_string(const char *str) { struct escaped_string *escapedstr = malloc(sizeof(*escapedstr)); if (!escapedstr) {