title: Node.js Discord.Js Mysql
body: <p>I'm creating a Discord bot. When we asked about an error, the bot gives an answer about that error. But when I get MySQL Data, i'm trying post it to Discord but it saying <code>undefined</code>.</p>
  <p>Could you please help me?</p>
  <pre><code>const Discord = require(&quot;discord.js&quot;);
  const client = new Discord.Client();
  const ayarlar = require(&quot;./ayarlar.json&quot;);
  const mysql = require('mysql');
  
  var baglanti = mysql.createConnection({
    host: 'localhost',
    user: 'root',
    password: '',
    database: 'hatabot'
  });
  
  baglanti.connect(function (err) {
    if (err) throw err;
      console.log(&quot;baglanti basarili&quot;)
  client.on('message', msg =&gt; {
  
      baglanti.query(&quot;SELECT * from hatalar WHERE hata_komut LIKE &quot;+'%'+msg.content+'%',function(err,sonuc){
   
        console.log(msg.content+&quot; kelimesine ait\n\n&quot;+sonuc+&quot;\n\nsonucu bulundu&quot;);
      });
  });
  });
  
  
  client.login(ayarlar.token)
  </code></pre>