I received some information using html form tags
post={count:[1,2,3]}
the information collected is "post"
exports.log_create_process = function(request, response){
var _url = request.url;
var queryData = url.parse(_url, true).query;
var body = '';
request.on('data', function(data){
body = body + data;
});
request.on('end', function(){
var post = qs.parse(body);
var title = post.title;
var description = post.description;
var query=``;
for(var i=0; i<post.length; i++){
db.query(`INSERT INTO stock_log(count) VALUES (${post[i}.count);`,function(error, result){
response.end();
});
}
});
}
My goal is to send queries three times. Assuming the table was initially empty. After the log_create_process has completed the table should look like this:
| count|
| 1 |
| 2 |
| 3 |