Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 15th, 2013  |  syntax: JavaScript  |  size: 0.65 KB  |  views: 165  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. async.waterfall([
  2.     function (callback) {
  3.         connection.connect(callback)
  4.     },
  5.     function (callback) {
  6.         connection.query(sqlFindMobile, [req.body.mobile], callback)
  7.     },
  8.     function (results, callback) {
  9.         console.log("mobile query");
  10.         connection.query(sqlNewUser, [req.body.password], callback)
  11.     },
  12.     function (results) {
  13.         console.log("added user");
  14.         var user_id = results.insertId;
  15.         connection.query(sqlNewMobile, [user_id, req.body.mobile], callback)
  16.     },
  17. ],
  18. function (err, result) {
  19.     connection.end()
  20.     if (err) {
  21.         throw err
  22.     }
  23.     console.log("added mobile");
  24. })