1

Can anyone figure out what I'm doing wrong here? The error message is rather vague...

16-Apr-2012 17:36:42] WordPress database error 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 '' at line 24 for query CREATE TABLE wp_psadata(
    id INTEGER(10) UNSIGNED AUTO_INCREMENT,
    date_entered TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    submitter_name VARCHAR(255),
    submitter_email VARCHAR(255),
    submitter_phone VARCHAR(255),
    event_name VARCHAR(255),
    location_name VARCHAR(255),
    address VARCHAR(255),
    city VARCHAR(255),
    state VARCHAR(255),
    zipcode VARCHAR(5),
    phone VARCHAR(255),
    email VARCHAR(255),
    uri VARCHAR(255),
    event_start_date DATE,
    event_start_time TIME,
    event_end_date DATE,
    event_end_time TIME,
    recurs_on_dow TINYINT,
    description VARCHAR(4000),
    comments VARCHAR(4000), 
    active TINYINT DEFAULT 1,
    wants_reach_at_event TINYINT DEFAULT 0 made by activate_plugin, do_action, call_user_func_array, psa_activate, dbDelta

Using: SQLite version 2.8.17 - 3.7.4 / PHP version 5.3.6

Thank you!

EDITED:

Here is my actual code in PHP. The code above is from the log, so it might be missing something:

$sql = 'CREATE TABLE '. $table_name . '(
    id INTEGER(10) UNSIGNED AUTO_INCREMENT,
    date_entered TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    submitter_name VARCHAR(255),
    submitter_email VARCHAR(255),
    submitter_phone VARCHAR(255),
    event_name VARCHAR(255),
    location_name VARCHAR(255),
    address VARCHAR(255),
    city VARCHAR(255),
    state VARCHAR(255),
    zipcode VARCHAR(5),
    phone VARCHAR(255),
    email VARCHAR(255),
    uri VARCHAR(255),
    event_start_date DATE,
    event_start_time TIME,
    event_end_date DATE,
    event_end_time TIME,
    recurs_on_dow TINYINT,
    description VARCHAR(4000),
    comments VARCHAR(4000), 
    active TINYINT DEFAULT 1,
    wants_reach_at_event TINYINT DEFAULT 0;
    PRIMARY KEY  (ID) )';
2
  • It seems that you didn't close with a ) at the end. Commented Apr 16, 2012 at 17:49
  • I edited my original post to include the actual code. Commented Apr 16, 2012 at 18:15

1 Answer 1

4

Edit:

You have a semi-colon after this line, which is a mysql statement delimiter.

wants_reach_at_event TINYINT DEFAULT 0; <--

You probably meant for it to be a comma ,

wants_reach_at_event TINYINT DEFAULT 0,
PRIMARY KEY  (ID) )';
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you! That did it! Sometimes we just need an extra set of eyes on the problem! :o)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.