title: sql query not working on node.js mysql but works on terminal
body: <p>i have an sql query as follows</p>
  
  <pre><code>select profileName from user where (id) in ( select id FROM( SELECT user_id1 as id from user_connection where user_id2=(select id from user where profileName='deva') UNION ALL SELECT user_id2 as id from user_connection where user_id1=(select id from user where profileName='deva')) t GROUP BY id) ;
  </code></pre>
  
  <p>works like a magic on terminal, but on node.js it's having sql query error</p>
  
  <pre><code>exports.findFriends = function(userName,callback){
  console.log('searching friends.... '+userName);
  var findFriendsQuery = 'select profileName from user where (id) in ( select id FROM ( SELECT user_id1 as id from user_connection where user_id2=(select id from user where profileName= ? ) UNION ALL SELECT user_id2 as id from user_connection where user_id1=(select id from user where profileName=?)) t GROUP BY id)' ;
    db.query(findFriendsQuery,[userName],function(err,rows,fields){
      if(err){
       console.log(err);
       callback(1,-1,-1);
       }
      else{
          callback(0,rows,1);
          }
      });
  };
  </code></pre>
  
  <blockquote>
    <p>sqlMessage: '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 \'?)) t GROUP BY id)\' at line 1',
      sqlState: '42000',
      index: 0,</p>
  </blockquote>