Iva*_*žić 8 mysql node.js bluebird
我无法使用node.js lib mysljs在我的数据库中使用批量插入.
我按照以下答案:
没有成功.
var sql = "INSERT INTO resources (resource_container_id, name, title, extension, mime_type, size) VALUES ?";
var values = [
[1, 'pic1', 'title1', '.png', 'image/png', 500],
[1, 'pic2', 'title2', '.png', 'image/png', 700]];
return connection.query(sql, [values], (result) => {
if (err) throw err;
connection.end();
});
Run Code Online (Sandbox Code Playgroud)
我一直收到错误:
'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'?\' at line 1'
Run Code Online (Sandbox Code Playgroud)
我也尝试使用蓝鸟宣传查询方法,但没有成功,我再次得到同样的错误.
| 归档时间: |
|
| 查看次数: |
709 次 |
| 最近记录: |