0

The best information I can get is

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 VARCHAR (1000), postdate DATETIME DEFAULT CURRENT_TIMESTAMP)' at line 1

about my query

$wpdb->query("CREATE TABLE jobs (id MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY, title VARCHAR (50), desc VARCHAR (1000), postdate DATETIME DEFAULT CURRENT_TIMESTAMP) $charset_collate")

What is the error? I know it's probably obvious, so forgive me (I'm a n00b). Regarding the postdate column, I was taking the syntax straight from the answer on mysql automatically store record creation timestamp.

Community
  • 1
  • 1
  • desc is a reserved word. The error in the error message is nearly always at, or immediately to the left of, the first word in the error message. – Strawberry Jul 21 '15 at 16:25

1 Answers1

1

desc is a reserved keyword in MySQL and needs to be escaped by backticks.

... , `desc` VARCHAR (1000) ...
juergen d
  • 201,996
  • 37
  • 293
  • 362