Can't insert data into my database using wamp server and php

It gives me this error:

Error: insert into employee_data (name, surname, age, username, password values ('agag','agag','22','abc','abc') You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values ('agag','agag','22','abc','abc')' at line 1

When i tested this code:

enter image description here

I'm using wamp server and notepad++ for coding. Please help me im going so hard on this project for my school, would appreciate all help.

testing if data as been inserted

Upvotes: 0

Views: 1599

Answers (1)

Tpojka
Tpojka

Reputation: 7111

Seems like syntax error. On image you posted, it looks like parenthesis after password is forgotten. Closing it should be ok. Also, I would like to mention you that beside the images posting actual code is best way one could get to try help and solve issue. Check this article of how to ask best way.

INSERT INTO `employee_data` (`name`, `surname`, `age`, `username`, `password`) VALUES ('agag','agag','22','abc','abc');

Also, pay attention on having variables like tables/columns name wrapped with backticks and other security matters.

Upvotes: 1

Related Questions