0

All the column names are correct and data types should be fine, but this throws:

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 'desc, owner, burl) VALUES ('1', '2', '3', '4', '5')' at line 1

mysql_query("INSERT INTO servers (ip, name, desc, owner, burl) VALUES ('1', '2', '3', '4', '5')") or die(mysql_error());

2 Answers 2

1
mysql_query("INSERT INTO servers (ip, name, `desc`, owner, burl) VALUES ('1', '2', '3', '4', '5')") or die(mysql_error());

Make sure you backtick column names that uses special words like DESC

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks very much, didnt know it was a special word
0

desc is a reserved word.

see http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html

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.