title: How to Insert JSON Parsed data into MYSQL
body: <p>Here I am trying to insert JSON Parsed Data into MYSQL Database.  I created Table in MYSQL with  3 columns - link,url,description.My Table name in MYSQL is  information.. My code does not working. I am unable to find the mistake.. Can anyone help me!! Here is my code</p>
  
  <h2>dbStore.js</h2>
  
  <pre><code>var express=require('express');
  var mysql=require('mysql');
  var config = require('./config.json');
  
  var dbConnect = mysql.createConnection({
  user     :  config.user,
  password :  config.password,
  database :  config.database
  });
  
  dbConnect.connect(function(err){
      if(err){
          console.log(err);
      }else{
          console.log("connection success");
      }
  });
  
  function insert() {
      var key = $("#search1").val();
      var htmlContent = "";
      $.ajax({
          type: "GET",
          url: "http://api.duckduckgo.com/?q=" + key + "&amp;format=json&amp;pretty=1",
          dataType: "jsonp",
          success: function (data, status, jqXHR) {
              alert("on success");
              if (data.RelatedTopics.length != "") {
                  for (var i = 0; i &lt; data.RelatedTopics.length; i++) {
                      var desc = data.RelatedTopics[i].Text;
                      var url  = data.RelatedTopics[i].Icon.URL;
                      var link = data.RelatedTopics[i].FirstURL;
                      var data={
                          link: link,
                          url: url,
                          description: desc
                      };
                      dbConnect.query('INSERT INTO information SET?',data,function(err,res){});
                      htmlContent += "";
                      $('#div1').html(htmlContent);
                  }
              }
          },
          error: "error"
      });
  };
  </code></pre>
  
  <p>Table name is information(columns- link,url,description) .From my html page on-click event I called the insert() function in dbStore.js that will parse json data from api and insert data in table.  Thank you in advance.    </p>