0

I have a simple query code that always gives me an error, no idea what could be wrong.

The code is:

INSERT INTO 'email' ('id','firstname','lastname','email') VALUES ('','Peter','Miller','test@mail.com');

And I get the following error:

#1064 - 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 ''email' ('id','firstname','lastname','email') VALUES ('','Peter','Miller','test@' at line 1

Dharman
  • 30,962
  • 25
  • 85
  • 135
carupe
  • 3
  • 1

1 Answers1

0

Remove the quotes from around the email table name.

  • Tried, then the error just goes on... #1064 - 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 ''id','firstname','lastname','email') VALUES ('','Peter','Miller','test@mail.com'' at line 1 – carupe Apr 01 '19 at 15:15
  • Oh, I missed that you had quotes around field names as well, you'll need to remove those too. Only the literal string values you're inserting should have quotes around them. – upsidedowncreature Apr 01 '19 at 15:39
  • Ok, now it works. I was literally doing it as the tutorial showed and didnt work, but now it does :) Thanks. – carupe Apr 01 '19 at 16:02