fixed last commits
[NeonServV5.git] / DBHelper.c
index 587158635b065e64283c71849adfb479d250cc06..c8efb6b12092c13715b11aafdf8f36d894d808e2 100644 (file)
@@ -118,13 +118,13 @@ int isUserProtected(struct ChanNode *chan, struct UserNode *victim, struct UserN
     char protection;
     loadChannelSettings(chan);
     if(!(chan->flags & CHANFLAG_CHAN_REGISTERED)) return 0;
-    printf_mysql_query("SELECT `channel_protect` FROM `channels` WHERE `channel_id` = '%d'");
+    printf_mysql_query("SELECT `channel_protect` FROM `channels` WHERE `channel_id` = '%d'", chan->channel_id);
     res = mysql_use();
     if(!(row = mysql_fetch_row(res))) return 0;
     if(row[0]) {
         protection = (char) atoi(row[0]);
     } else {
-         printf_mysql_query("SELECT `channel_protect` FROM `channels` WHERE `channel_name` = 'defaults'", chan->channel_id);
+         printf_mysql_query("SELECT `channel_protect` FROM `channels` WHERE `channel_name` = 'defaults'");
         res = mysql_use();
         row = mysql_fetch_row(res);
         protection = (char) atoi(row[0]);