Column count doesn't match value count at row 1!! HELP!

Discussion in 'MySQL' started by fordsho, Jan 3, 2010.

  1. #1
    One- of 6 errors all the same...
    Error

    SQL query:

    INSERT INTO `wp_posts` VALUES ('98090', '1', '2008-08-28 13:14:48', '2008-08-28 13:14:48', '
    Category: Drama
    All Genres: Drama, Horror, Music
    Release Year: 1989
    Country: USA
    Runtime: 93
    Rating: 7.8 (0)
    Languages: English
    Director: Dwight H. Little
    Sound: Ultra Stereo
    Taglines:
    # The final curtain is about to drop.
    # Only love and music are forever
    # Robert Englund... was "Freddy" now hes the Phantom of the Opera! An all new nightmare!

    Writing by: Gaston Leroux - novel
    Gerry OHara - based on a screenplay by
    Duke Sandefur - screenplay

    Produced by:

    MySQL said: Documentation
    #1136 - Column count doesn't match value count at row 1



    How can i correct this issue!!
     
    fordsho, Jan 3, 2010 IP
  2. rayqsl

    rayqsl Active Member

    Messages:
    91
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    53
    #2
    What the error is telling you is that you don't have data for all of the columns in the table.

    We need to see your table layout and the SQL code that is being run.
     
    rayqsl, Jan 4, 2010 IP
  3. basia

    basia Well-Known Member

    Messages:
    263
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    155
    #3
    Here's an SQL query that correctly inserts records into the wp_posts Wordpress table:

    $query = "INSERT INTO wp_posts VALUES (NULL, 1, NOW(), NOW(), '$content', '$title', 8, '', 'publish', 'open', 'open', '', '$slug', '', '', NOW(), NOW(), '', 0, '', 0, 'post', '', 0);";
     
    basia, Jan 6, 2010 IP