I get SQL syntax error

Avatar
  • Answered
when i submit details in my user regestration system i get this error in my php,

-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 'user reg`` (FirstName, LastName, Email, UserName, PassWord) VALUES ('FirstName',' at line 1-

-In php it show this-
Error

Static analysis:

14 errors were found during analysis.

1.Unexpected character. (near "[" at position 112)
2.Unexpected character. (near "]" at position 120)
3.Unexpected character. (near "[" at position 122)
4.Unexpected character. (near "]" at position 130)
5.Unexpected character. (near "[" at position 132)
6.Unexpected character. (near "]" at position 140)
7.Unexpected character. (near "[" at position 142)
8.Unexpected character. (near "]" at position 150)
9.Unexpected character. (near "[" at position 152)
10.Unexpected character. (near "]" at position 160)
11.Unexpected character. (near "[" at position 162)
12.Unexpected character. (near "]" at position 170)
13.Unexpected character. (near "[" at position 172)
14.Unexpected character. (near "]" at position 180)


SQL query:

INSERT INTO `user reg`(`UserID`, `FirstName`, `LastName`, `Email`, `UserName`, `PassWord`, `TimeStamp`) VALUES ([value-1],[value-2],[value-3],[value-4],[value-5],[value-6],[value-7])

MySQL said: Documentation
#1064 - 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 '[value-1],[value-2],[value-3],[value-4],[value-5],[value-6],[value-7])' at line 1
Avatar
Scott
Hello, Sorry to hear you are getting a 1064 error in your SQL queries. 1064 errors are simply syntax errors, which is the equivalent of a grammatical mistake for programming. There can be many different causes, so you may want to check out our article on the main causes of 1064 SQL errors and see if your situation fits those. Kindest Regards, Scott M