SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2008
    Location
    Hessle, East Yorkshire UK
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Trouble with Table Definition on some setups

    Hi all

    I have a Wordpress plugin that creates a table, some people have reported that this does not get created. When I have asked then to run the definition in manually they get errors, when I do it, it creates the table correctly without any problems.

    The reported error is:

    #1064 - 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
    'fields text,
    file_lines int(15) default '0',
    post_content text,
    post_ti' at line 5

    I did not think that the table was doing anything out of the ordinary so if anyone can help I would appreciate it.

    The table is as follows:

    CREATE TABLE wp_multifeed (
    id int(11) NOT NULL auto_increment,
    title varchar(255) default '',
    file varchar(255) default '',
    fields text,
    file_lines int(15) default '0',
    post_content text,
    post_title text,
    tags text,
    categories text,
    remove int(2) default '0',
    isunique varchar(50) default '',
    one varchar(10) default '',
    custom_names text,
    custom_values text,
    chkshed smallint(2) default '0',
    noofposts int(10) default '0',
    post_int int(10) default '0',
    comment_status smallint(2) default '0',
    ping_status smallint(2) default '0',
    condition1 varchar(10) default '',
    condition1value varchar(255) default '',
    condition1type varchar(64) default '',
    condition2 varchar(10) default '',
    condition2value varchar(255) default '',
    condition2type varchar(64) default '',
    usecondition varchar(10) default '',
    localfile text,
    url text,
    file_date timestamp NOT NULL default CURRENT_TIMESTAMP,
    advanced varchar(10) default '',
    start varchar(10) default '',
    finish varchar(10) default '',
    slt_intrtype varchar(10) default '',
    PRIMARY KEY (id)
    ) AUTO_INCREMENT=3;


    Thanks

    Matt Houldsworth
    Digitalquill

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2007
    Location
    Yorkshire, UK
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    could it be the quotes around the zeros for the default values in the integer fields?

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2007
    Location
    Yorkshire, UK
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    or, are "fields" and "file" are reserved words in MySQL? I think they are, but why your commands works for you and not for others is more puzzling. Are you all using the same version of MySQL?

  4. #4
    SitePoint Enthusiast
    Join Date
    Jan 2008
    Location
    Hessle, East Yorkshire UK
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi

    Thanks for your reply

    I first thought reserved words but I checked on the mysql site and they appear ok.

    Tried with the quotes but that does not seem to make any difference.

    My problem is I can not replicate the issue so any fixes have to be run by one of my users who is having the problem.

    Could PhPMyAdmin be causing it? I do it straight into the command line, the user who is testing it for me uses PHPMyAdmin to manage his MySQL

    Matt

  5. #5
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,274
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    could be a different version of mysql
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •