Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (!data.first_id) {
- io.sockets.emit('total comment', {total_comment: 0});
- return false;
- }
- var q = 'SELECT * FROM comments Where status = 1 And comment_id Is Null ' +
- ' And new = ' + parseInt(data.new_id) + ' And id > ' + parseInt(data.first_id);
- connectionComments.query(q)
- .on('result', function (data) {
- comments.push(data);
- })
- .on('end', function () {
- io.sockets.emit('total comment', {total_comment: comments.length});
- });
- });
- if (data.total_comment > 0) {
- console.log('não chega aqui');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement