• I’m trying to insert about 30 posts from one blog’s database into a 2nd blog’s database. I went into phpMyAdmin and did the following.
    INSERT INTO wp_posts
    VALUES ( 85, 2, ‘2004-07-23 15:23:58’, ‘2004-07-23 20:23:58’, ‘All week I have been working on a new web site. It”s called Walt Disney Resource, and it”s essentially the same content I had in the Disney section of this site. Now it has a new color scheme, and it”s own domain name, as well as updated content. So be sure to change your bookmarks if you frequent my disney section.’, ‘New Disney Site Launched’, 0, 0, ”, ‘publish’, ‘open’, ‘closed’, ”, NULL , NULL , ‘new-disney-site-launched’, ”, ”, ‘2004-09-04 16:38:10’, ‘2004-09-04 21:38:10’, ”, 0 )
    I got an error: #1136 – Column count doesn’t match value count at row 1.
    Can anyone help me figure this one out?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter joshuaclinard

    (@joshuaclinard)

    Can anyone help me figure this one out?

    Thread Starter joshuaclinard

    (@joshuaclinard)

    It appears that rows from the two databases are different. Below is a row from the new database. Can someone tell me why they are diffrent. The first row is from 1.2.1 and the second row is from 1.2. I didn’t run an upgrade script, so there shouldn’t have been any database changes. What’s the deal? I’ll upgrade the second one, and see if it fixes it.
    INSERT INTO wp_posts VALUES (1, 2, ‘2001-01-23 12:48:00’, ‘2001-01-23 17:48:00’, ‘Welcome to my totally new web site! It is finally published! I am sorry that it has taken longer than expected, but I got a cold over the weekend. Now that the site is live, I”d like to mention a few things that you should know about the site. I have not yet published the photos for CBC 2000, because I don”t yet have access to the scanners at ACU, but they are coming soon! I don”t know exactly when, but it should be within a few weeks. I wanted to go ahead and get the rest of the site up. Also, you”ll notice on the CBC Songbook section that only 10 songs are currently up. I will try to get at least 2 or 3 more added every week. I have tested the site, but I may have missed something, so If you notice anything not working, just use my contact form. I am just so excited that the site is finally live! Well, there”s just one more thing that I should mention. This page will be updated regularly, so if you want to know what”s going on in my life, or with the site, check back often! And last but not least, welcome to Joshua”s Place!’, ‘Welcome to Joshua\\”s Place Version 2.0!’, 1, ”, NULL, NULL, ‘publish’, ‘open’, ‘open’, ”, ‘hello-world’, ”, ”, ‘2004-09-28 14:49:36’, ‘2004-09-28 19:49:36’, ”, 0);

    Thread Starter joshuaclinard

    (@joshuaclinard)

    I just upgraded the second instance of WP, and ran upgrade.php on both instances. The databases still have NULL, NULL, publish, open, open in opposite order. How can I get them to match? Would someone please help?

    The trick is to list the fields you’re inserting into first so your INSERT statement isn’t dependent on the order, which may vary. Try redoing your SQL like so:
    INSERT INTO wp_posts
    (field1, field2, field3, field4)
    VALUES
    ('value1', '', 1232312, 'value4')

    Thread Starter joshuaclinard

    (@joshuaclinard)

    I really don’t know if I understand what you mean. I just want some way to make them match up, so that I can remove the 40 queries from one database to the other. Could a php script be written that would move them to the right place?

    Thread Starter joshuaclinard

    (@joshuaclinard)

    I figured that part out. But there is another problem. I have a post_karma field in the first database but not in the second. Is there a hack I could have installed that would have added that field to the db, or is it supposed to be there by default? I don’t recall installing any hacks to this wp. If I drop the karma field from the first database, and then re-copy the SQL, will it work?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Trouble with MySQL’ is closed to new replies.