if(criteria->unvisited) {
printf_mysql_query("SELECT `chanuser_seen` FROM `chanusers` WHERE `chanuser_cid` = '%s' ORDER BY `chanuser_seen` DESC LIMIT 1", row[5]);
res2 = mysql_use();
- row2 = mysql_fetch_row(res);
+ row2 = mysql_fetch_row(res2);
if(!row2) continue;
if((time(0) - atoi(row2[0])) < criteria->unvisited) continue;
}