WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a plugin that creates tables and one of them is failing and I feel like it's due to either my syntax or the fact that I'm trying to create a column with datatype DATE and not TIMESTAMP (only one that I can make work). Can someone look at my syntax below and tell me what is wrong?

$table = $wpdb->prefix.SSM_ACADEMIC_YEAR_TABLE;

        $sql =  "CREATE TABLE IF NOT EXISTS " . $table . " (
                  id mediumint(12) NOT NULL AUTO_INCREMENT,
                  description VARCHAR(200) NOT NULL,
                  begin_date DATE NOT NULL, 
                  end_date DATE NOT NULL
                PRIMARY KEY (id));";


and now just looking at the other field in question, is it possible that it doesn't like VARCHAR(200)? Having issues here and running out of steam and time. Any help would be greatly appreciated!

share|improve this question
up vote 0 down vote accepted

Well, after looking at the other tables I had created successfully, only difference was the description column. Apparently WordPress or MySQL doesn't like that as a column name and somehow has it reserved. So, after renaming it, the table was created fine. Hope this helps someone else in the same boat.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.