I am having trouble creating a table with the name 'ADD' as a user submits this word in a php form. Any other user entry into the form works fine in creating a table.
Here is the error line "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 'add (Name VARCHAR(30), Day INT(3), Month VARCHAR(15), Year INT(5), Shift VARCHAR' at line 1"
Why only this error with the word 'ADD'
Help Please!
Problem with the word ADD
Moderator: General Moderators
Re: Problem with the word ADD
Try using backticks (`) around the table name. Add is probably a reserved word.
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Problem with the word ADD
ADD is a reserved word. You'll need to quote it to use it.
-Shawn
-Shawn
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: Problem with the word ADD
Yeah, cause that isn't exactly what I just said -_-
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Problem with the word ADD
Doh! I had this window open, went out for a smoke, came back and answered it.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: Problem with the word ADD
haha
Ahh well, nice to know someone agrees with me ;p
...you were out for 22 mins?! Wonder what you were smoking...
Ahh well, nice to know someone agrees with me ;p
...you were out for 22 mins?! Wonder what you were smoking...