* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * InspIRCd is copyright (C) 2002-2004 ChatSpike-Dev.
* E-mail:
* <brain@chatspike.net>
* <Craig@chatspike.net>
#include "m_sql.h"
/* $ModDesc: SQL Service Provider module for all other m_sql* modules */
-/* $CompileFlags: -I/usr/local/include/mysql -I/usr/include/mysql -I/usr/local/include -I/usr/include -L/usr/local/lib/mysql -L/usr/lib/mysql -L/usr/local/lib -lmysqlclient */
+/* $CompileFlags: -I/usr/local/include/mysql -I/usr/include/mysql -I/usr/local/include -I/usr/include */
+/* $LinkerFlags: -L/usr/local/lib/mysql -Wl,--rpath -Wl,/usr/local/lib/mysql -L/usr/lib/mysql -Wl,--rpath -Wl,/usr/lib/mysql -lmysqlclient */
/** SQLConnection represents one mysql session.
* Each session has its own persistent connection to the database.
if (row)
{
unsigned int field_count = 0;
+ MYSQL_FIELD *fields = mysql_fetch_fields(res);
if(mysql_field_count(&connection) == 0)
return thisrow;
- MYSQL_FIELD *fields = mysql_fetch_fields(res);
- while (field_count < mysql_field_count(&connection))
+ if (fields && mysql_field_count(&connection))
{
- thisrow[std::string(fields[field_count].name)] = std::string(row[field_count]);
- field_count++;
+ while (field_count < mysql_field_count(&connection))
+ {
+ std::string a = (fields[field_count].name ? fields[field_count].name : "");
+ std::string b = (row[field_count] ? row[field_count] : "");
+ thisrow[a] = b;
+ field_count++;
+ }
+ return thisrow;
}
- return thisrow;
}
}
return thisrow;
}
}
+ void Implements(char* List)
+ {
+ List[I_OnRehash] = List[I_OnRequest] = 1;
+ }
+
char* OnRequest(Request* request)
{
if (request)