Advertisement
Guest User

Untitled

a guest
Sep 16th, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. if (!data.first_id) {
  2. io.sockets.emit('total comment', {total_comment: 0});
  3. return false;
  4. }
  5.  
  6. var q = 'SELECT * FROM comments Where status = 1 And comment_id Is Null ' +
  7. ' And new = ' + parseInt(data.new_id) + ' And id > ' + parseInt(data.first_id);
  8.  
  9. connectionComments.query(q)
  10. .on('result', function (data) {
  11. comments.push(data);
  12. })
  13. .on('end', function () {
  14. io.sockets.emit('total comment', {total_comment: comments.length});
  15. });
  16.  
  17. });
  18.  
  19. if (data.total_comment > 0) {
  20.  
  21. console.log('não chega aqui');
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement