• Hi, guys!

    I have the following query in a plugin install function:

    $create_templates_table_sql = “CREATE TABLE ” . $wpdb->templates . ” (
    id int(11) NOT NULL AUTO_INCREMENT,
    template_author bigint(20) NOT NULL DEFAULT ‘0’,
    name varchar(255) NOT NULL,
    before_template text NOT NULL,
    after_template text NOT NULL,
    css text NOT NULL,
    js text NOT NULL,
    status varchar(255) NOT NULL,
    last_modified datetime NOT NULL,
    date_added datetime NOT NULL,
    PRIMARY KEY (id)) CHARSET=”.self::getCharset().” ;”;

    The wordpress-database-abstraction cuts this query to “);”.
    The problem starts here:
    wp-content\mu-plugins\wp-db-abstraction\translations\sqlsrv\translations.php, line 1152:

    if(stripos($query, ‘AFTER’) > 0) {
    $start_pos = stripos($query, ‘AFTER’);
    $query = substr($query, 0, $start_pos);
    }

    I.e. if a column name contains MySQL keyword (in our case this word is ‘after’) then the queries become invalid. Would you please fix that?

    My WP (ver 3.5.1) is runnign locally on IIS 7.5 using MSSQL 2008.

    Best regards,
    Alex

    http://wordpress.org/extend/plugins/wordpress-database-abstraction/

  • The topic ‘The plugin cuts queries’ is closed to new replies.