title: ER_PARSE_ERROR: You have an error in your SQL syntax - Node JS
body: <p>Hi I am working on mysql database with node js. Much of the data get inserted but at this point the query stuck, I don't know why. I tried <code>mysql.escape()</code> and <code>utf8.encode()</code> but still the same error.</p>
  
  <p><strong>This is my query</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>                ms_connect.query("INSERT INTO `companies_jobs` VALUES (null, '"+mysql.escape(data[i].title)+"','"+mysql.escape(data[i].link)+"','"+mysql.escape(data[i].date)+"','"+mysql.escape(data[i].level)+"','"+mysql.escape(data[i].category)+"','"+mysql.escape(data[i].function)+"','"+mysql.escape(data[i].loc)+"','"+mysql.escape(data[i].timing)+"','"+mysql.escape(data[i].company)+"','"+JSON.stringify(time)+"','"+JSON.stringify(date)+"',"+1+")", function(err, row){
                      if(err){
                          console.log(data[i]);
                          throw err;
                      } else{
                          i++;
                          s();
                      }
                  })</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>I am trying to insert this data into the database :</strong> </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>[{
    category: 'Sales',
    company: '',
    date: 'Posted on 12/06/2018',
    function: '',
    level: 'Students',
    link: 'https://career5.successfactors.eu/career?career%5fns=job%5flisting&amp;company=LiMySLive&amp;navBarLevel=JOB%5fSEARCH&amp;rcm%5fsite%5flocale=en%5fUS&amp;career_job_req_id=13305&amp;selected_lang=es_ES&amp;jobAlertController_jobAlertId=&amp;jobAlertController_jobAlertName=&amp;_s.crb=fl08QG2oV1akJFW%2fWVQ4Ol50v%2bs%3d',
    loc: 'Chile (CL)',
    timing: 'full time',
    title: 'Alumno en Practica'
  }]</code></pre>
  </div>
  </div>
  </p>
  
  <p>But due to some reason, I get this error : </p>
  
  <blockquote>
    <p>ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Alumno en Practica'',''<a href="https://career5.successfactors.eu/career?career%5fns=job%" rel="nofollow noreferrer">https://career5.successfactors.eu/career?career%5fns=job%</a>' at line 1</p>
  </blockquote>
  
  <p>This is how the table structure : </p>
  
  <p><a href="https://i.stack.imgur.com/lPDkC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lPDkC.png" alt="enter image description here"></a></p>