SHARE
TWEET

Untitled

a guest Jan 15th, 2013 289 Never
  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. })
RAW Paste Data
Top