1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
| var pool = mysql.createPool({
connectionLimit : 150,
host : 'localhost',
user : 'root',
password : '1234',
database : 'node'
});
...
...
...
//members
router.post('/members', function(req,res){
// console.log(req.body);
var attr = req.body;
delete(attr.id_ch);
delete(attr.pass_ch);
delete(attr.email_ch);
delete(attr.tel1);
delete(attr.m_tel2);
delete(attr.m_tel3);
delete(attr.m_pass_ch);
var queryString = 'Insert into member Set ?';
pool.getConnection(function(err,connection){
connection.query(queryString,req.body, function(err, result) {
if (err) throw err;
console.log("insert member!");
});
connection.release();
res.render('members',req.body);
});
});
|
댓글 없음:
댓글 쓰기