fronix

Untitled

Jan 30th, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. db.connect(function(err, results) {
  2. if (err) {
  3. console.log("ERROR: " + err.message);
  4. throw err;
  5. }
  6. var get = getChar(db);
  7.  
  8. console.log(get);
  9. });
  10.  
  11. getChar = function(db)
  12. {
  13. db.query(
  14. 'SELECT * FROM simulation_queue WHERE cooldown > UNIX_TIMESTAMP(NOW()) AND simulated=0 ORDER BY cooldown DESC LIMIT 1',
  15. function selectCb(err, results, fields) {
  16. if(results.length == 1){
  17. console.log(results);
  18. }else{
  19. return false;
  20. }
  21. });
  22. };
Advertisement
Add Comment
Please, Sign In to add comment