1

When adding rows to a table I am getting Error: column does not exist and I am not sure why. I know the table does and it is fairly straight forward. Here is what I have to add and here is what the table looks like. Any help would be great and let me know if you have any questions. Thanks!

Whatever value I have in emailField it is giving me the error that emailfield column does not exist

final String addemployee = "insert into employee values ('" + name_field.getText() + "', '" + usersSuper.getText() + "', '" + true + "' , md5('" +    passwordField.getText() + "') , "  + emailField.getText() + ");";

Here is the table

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)
)
3
  • 1
    you've missed quotes around emailField.getText()? it should be '" + emailField.getText() + "' Commented Sep 24, 2013 at 14:36
  • Not sure how I missed that one but thanks for your help Roman! Commented Sep 24, 2013 at 14:45
  • i hope you are only storing salted hashes and not real passwords. Commented Sep 24, 2013 at 14:46

2 Answers 2

1

Try

final String addemployee = "insert into employee values ('" + name_field.getText() + "', '" + usersSuper.getText() + "', '" + true + "' , md5('" + passwordField.getText() + "') , '" + emailField.getText() + "');";
Sign up to request clarification or add additional context in comments.

Comments

0

You've missed quotes around emailField.getText()? it should be '" + emailField.getText() + "'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.