title: SQL syntax issue with Discord bot development (mySQL 8.0)
body: <p>I know this issue has been handled before on this website, but I have tried everything I have seen and for some season nothing works... so it might be something more specific. Again, I apologize if I might have missed something but I am new and frustrated with why this isn't working...</p>
  
  <p>My code is this:</p>
  
  <pre><code>bot.on(`message`, async message =&gt; {
    if(message.author.bot) return;
    if(message.channel.type === "dm") return;
  
    con.query(`SELECT * FROM profile WHERE id = '${message.author.id}'`, (err, rows) =&gt; {
      if(err) throw err;
  
      var sql;
  
      if(rows.length &lt; 1) {
        var sql = (`INSERT INTO profile (id, username) VALUES (${message.author.id}, ${message.author.tag})`);
      };
  
      con.query(sql, console.log);
      if (err) throw err;
      console.log("1 record inserted");
    });
  </code></pre>
  
  <p>I am trying to get the person's Discord ID and username to be placed in the database. I have dozens of different configurations for this code and it keeps giving me syntax errors. I have noticed mySQL 8.0 have very different syntax requirements compared to other tutorials I have watched. I have referenced the mySQL website to try and figure out my problem. I have spent 2 days on this issue and I am at the end of my rope, so I am asking for help!</p>
  
  <p>Thanks in advance for your time! :)</p>