0

I'm using MyBB as a forum software but I'm working on a discord bot in Node.js to chekc that db and see if the user has a certain rank within the additionalgroups value. Mybb stores them additional groups like 1,2. Was wondering how I could check for either value with MySql.

db.query("SELECT * FROM mybb_users WHERE uid= '" + result[0].ufid +"'", function (err, row, field) {
                    if(row[0].additionalgroups === 2){ // Member
                        console.log("Updated User to member");
                    }else if(row[0].additionalgroups === 4){ // LiteWare paid User
                        console.log("Updated User to User");
                    }else if(row[0].additionalgroups === 10){ // LiteWare Lifetime User
                        console.log("Updated User to Lifetime");
                    }
                
                    db.end();
                });

0 Answers0