向表中添加行时,我收到错误:列不存在,我不确定原因。我知道桌子的确如此,而且相当直接。这是我要添加的内容,这是表格的样子。任何帮助都会很棒,如果您有任何疑问,请告诉我。谢谢!
无论我在emailField
中拥有什么价值,它都会给我一个错误,即emailfield列不存在
final String addemployee = "insert into employee values ('" + name_field.getText() + "', '" + usersSuper.getText() + "', '" + true + "' , md5('" + passwordField.getText() + "') , " + emailField.getText() + ");";
这是表格
CREATE TABLE employee
(
name text NOT NULL,
manageremail text,
isadmin boolean NOT NULL,
userpassword text NOT NULL,
email text NOT NULL,
CONSTRAINT "user_Email" PRIMARY KEY (email)
)
答案 0 :(得分:1)
尝试
final String addemployee = "insert into employee values ('" + name_field.getText() + "', '" + usersSuper.getText() + "', '" + true + "' , md5('" + passwordField.getText() + "') , '" + emailField.getText() + "');";
答案 1 :(得分:0)
你错过了emailField.getText()的引用?它应该是'" + emailField.getText() + "'