• Resolved jamcom

    (@jamcom)


    I am trying to import a content database file into a wordpress set up, and it seems to go into the wrong section in the phpmyadmin, which is where I am directly importing it to.

    Am I importing it in the right place or should I use wordpress admin?

    I can share the file if anyone needs it to see what I am trying to import.

    Here is what I was trying to import (a snippet of the code from the sql file)

    CREATE TABLErecipes` (
    id int(11) default NULL,
    title varchar(255) default NULL,
    titlecat varchar(255) default NULL,
    recipe longtext,
    category varchar(64) default NULL,
    category2 varchar(255) default NULL,
    category3 varchar(50) default NULL,
    category4 varchar(50) default NULL,
    KEY category (category),
    KEY category2 (category2)
    ) TYPE=MyISAM;

    INSERT INTO recipes VALUES (‘1’, ‘brie kisses’, ‘brie kisses recipe | brie recipes | appetizer recipes’, ‘<h1>Brie Kisses</h1><p>Makes 32.</p><p>1/2 to 2/3 pounds brie cheese (wedges are fine)
    1 (17.3 ounce) box frozen puff pastry
    Hot pepper jelly</p><p>Cut the brie into 1/2-inch squares (leave the rind on if you like). Place on a dinner plate and put the cheese in the freezer while you thaw the puff pastry for 30 minutes at room temperature.</p><p>Unfold the thawed pastry, press together seams and roll lightly with a rolling pin to smooth it out. Cut each sheet into fourths, then cut each fourth in half. Cut the halves in half to make 16 squares per sheet.</p><p>Lightly spray a mini-muffin pan with nonstick spray. Fit a piece of dough into each cup, pushing into the cup but leaving the edges sticking up. Place a dab of pepper jelly in each cup, then top with a piece of cheese.</p><p>Bake at 400 degrees F for 10 to 15 minutes, until golden. Serve warm. (Can be prepared ahead and refrigerated until ready to bake, or you can bake them and re-warm about 10 minutes at 350 degrees F before serving.)</p>’, ‘appetizers’, ‘brie’, null, null);`

    Ok here is some screens to see if it helps explain:

    I want the data in the sql file, part of which was in that code snippet to go into the table in the screenshot (circled blue).

    Any help would be much appreciated.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You are trying to create and insert data into a table called recipes but you want that data in wp_categories…

    If wp_categories is the ‘old’ (and obsolete”) WordPress category table not too sure this will work.

    Thread Starter jamcom

    (@jamcom)

    Thanks for the reply

    To get that data in to a wordpress category called recipes, what would I have to do or what would I have to alter in the data to make it work?

    I think I would copy and paste each recipe into a Post then assign the appropriate categories to each post.

    Thread Starter jamcom

    (@jamcom)

    There is no other way? because there is 24000 I need to import, that code was just a snippet, a very small snippet.

    Then import the file into another database, export that database as a csv file then use http://wordpress.org/extend/plugins/csv-importer/ to import those as posts.

    Might also break out just a small subset of that file to test rather than trying to do all 24,000 as a test.

    Thread Starter jamcom

    (@jamcom)

    ok thankyou, I will try that.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Need help importing a sql file into wordpress’ is closed to new replies.