static void neonserv_cmd_adduser_async1(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, char *nick, char *auth, int caccess) {
//we've got a valid auth now...
+ MYSQL_RES *res;
+ MYSQL_ROW row;
int userid;
printf_mysql_query("SELECT `user_id` FROM `users` WHERE `user_user` = '%s'", escape_string(auth));
res = mysql_use();
if ((row = mysql_fetch_row(res)) != NULL) {
- userid = atoi(res[0]);
+ userid = atoi(row[0]);
} else {
printf_mysql_query("INSERT INTO `users` (`user_user`) VALUES ('%s')", escape_string(auth));
userid = (int) mysql_insert_id(mysql_conn);