SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Member
    Join Date
    Apr 2010
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Syntax Error Near FIELD

    MySQL retourneerde:

    #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 default '',
    fil' at line 7

    SQL-query:
    Code MySQL:
    CREATE TABLE IF NOT EXISTS `wp_multifeed` (
     
    id int( 11 ) NOT NULL AUTO_INCREMENT ,
    title varchar( 255 ) default '',
    FILE varchar( 255 ) default '',
    FIELDS text default '',
    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',
    usecondition varchar( 10 ) default '',
    localfile text,
    url text default '',
    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 '',
    post_ids text,
    del_old int( 1 ) ,
    PRIMARY KEY ( id ) )
    Last edited by Mittineague; Apr 14, 2010 at 17:02. Reason: formatting

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,341
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    FIELDS is a reserved word, either rename the column or put backticks around it
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Member
    Join Date
    Apr 2010
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you verry much

  4. #4
    SitePoint Member
    Join Date
    Apr 2010
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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:
    Code MySQL:
    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
    Last edited by Mittineague; Apr 14, 2010 at 17:04. Reason: formatting

  5. #5
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,341
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    FIELDS is a reserved word, either rename the column or put backticks around it

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  6. #6
    SitePoint Member
    Join Date
    Apr 2010
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can you give a example modify code i am a noob thanks

  7. #7
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,341
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    what do you mean by "modify code" ?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  8. #8
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,260
    Mentioned
    196 Post(s)
    Tagged
    2 Thread(s)
    Hi ericeric29, welcome to the forums.

    I've put your code inside MySQL bbtags. Please notice the differences in color.

    See how FIELDS looks? You can't use that for a name or you'll get syntax errors.

    And using lowercase instead and removing the DEFAULT isn't not using it. See how the bbCode "fixed" it by changing it to uppercase? That's because it's a reserved word. Reserved meaning it's "already taken" and has "special significance".

    You can modify it to whatever you like, eg. myfields, hisfields, herfields, foofields, etc. etc. but it can't be fields.

    WordPress can be quite involved even for an experienced developer. So perhaps you should put this aside (or at least not release it) until you're not a "noob".

    Nothing personal, but as WordPress doesn't test plugins before they host them on the repository, you really shouldn't release a plugin until you better know what you're doing.

  9. #9
    SitePoint Member
    Join Date
    Apr 2010
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ((; this plugin i buy from http://www.digitalquill.co.uk/datafeedplugin/

    but seems not to work for me
    it dont can create a table


    i am a user noob i was thinking software i pay for is better ((;

  10. #10
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,260
    Mentioned
    196 Post(s)
    Tagged
    2 Thread(s)
    Well, if you paid for it, the author should provide support no?

    If not one-to-one support, maybe there's a support forum for plugin users? Or a support wiki? I wouldn't suggest hacking the code, you stand a good chance of making things worse, and when you do get support, having made your own changes is likely to upset the author.

    I don't know how much you paid for it, but IMHO it's better to use free open-source plugins that are hosted on the wordpress.org repository.

    EDIT: I went to the

    broken plugin: WordPress Datafeed Plugin

    site and there is a wiki, have you tried that.

    IMHO the

    Wordpress Datafeed plugin is too expensive

    for something that doesn't work.


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
  •