数组如何插入到mysql?

需要把数组插入到mysql数据库中,使用JavaScript
比如说我要插入的数组是:
[{"biaoduan":"1","amount":"1"},{"biaoduan":"2","amount":"2"},{"biaoduan":"3","amount":"3"},{"biaoduan":"4","amount":"4"},{"biaoduan":"5","amount":"5"}]
想把biaodaun和amount分别插入到数据库中两个对应的字段中,请问应该怎么做?

繁星coding
浏览 407回答 1
1回答

MMTTMM

使用node吗 如果是node-mysql的话const mysql = require('mysql').createConnection(options)let sql = 'insert into tableName set ? 'mysql.query(sql, array, callback)
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript