-/* mysqlConn.c - NeonServ v5.2
- * Copyright (C) 2011 Philipp Kreil (pk910)
+/* mysqlConn.c - NeonServ v5.3
+ * Copyright (C) 2011-2012 Philipp Kreil (pk910)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*/
#include "mysqlConn.h"
-#define DATABASE_VERSION "6"
+#define DATABASE_VERSION "13"
struct used_result {
MYSQL_RES *result;
}
}
+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) {