gpt4 book ai didi

javascript - 错误: SQLITE_ERROR: no such column: undefined

转载 作者:太空宇宙 更新时间:2023-11-04 01:41:43 24 4
gpt4 key购买 nike

我正在使用 SQLite3我有一个列,但错误表明未创建列“未定义”。

const SQLite = require('sqlite3').verbose();
const db = new SQLite.Database('./database.sqlite');
db.serialize(function() {
db.run(`INSERT INTO users (id, name, soul, money, level, exp, items, weapon,
armor, inbattle) VALUES(${message.author.id}, ${message.author.name},
"determination", 0, 1, 0, "DogFood", "Stick", "Bandage", "False");`);
})

事件.js:183 扔呃;//未处理的“错误”事件

错误:SQLITE_ERROR:没有这样的列:未定义

最佳答案

另一个错误的修复是将“”添加到${message.author.username}。最终代码:

const SQLite = require('sqlite3').verbose();
const db = new SQLite.Database('./database.sqlite');
db.serialize(function() {
db.run(`INSERT INTO users (id, name, soul, money, level, exp, items, weapon,
armor, inbattle) VALUES("${message.author.id}", "${message.author.username}",
"determination", 0, 1, 0, "DogFood", "Stick", "Bandage", "False");`);
})

关于javascript - 错误: SQLITE_ERROR: no such column: undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52673703/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com