title: My sql query using node js does not display the query result in hbs view, and i have used this method else where in the code
body: <p>const userName = req.body.userNames;
  const password = req.body.password;</p>
  <pre><code>con.query(&quot;SELECT * FROM users where email = ? AND password = ?&quot;, [userName, password], function(err, collections){
      if(err){
          console.log(err);
      }
      else {
          if(collections != 0){
              res.render('userProfile', {collections: collections})
              console.log(collections);
      }
      else{
          res.jason(&quot;Incorrect password or Account does not exist, check your login again.. Thank you&quot;);
      }
  }
  });
  </code></pre>
  <p>And here is my handle bars view &lt; li class = &quot;nav-item dropdown header-img-icon&quot; &gt;
  
  
   &lt; div class = &quot;dropdown-menu&quot; &gt;
  
  
  
  
  {{#each collections}}
  
  {{collections.fullName}}</p>
  {{collections.email}}</p>
  
  {{/each}}
  </p>