• Resolved jordan8201

    (@jordan8201)


    I have a database with a few hundred devotions that I would like to start using on my WordPress page. I am hoping not to have to copy and paste each of them into my WordPress page. Is there a way to somehow merge the two? Thank you very much!

Viewing 15 replies - 1 through 15 (of 97 total)
  • What’s the structure of the table holding all the devotions?..

    What exactly do you want to do with them?…

    If you can be specific i can proberly write you a short query to insert the data into your wordpress database tables, but you’ll need to be specific about what you want done with the data…

    Thread Starter jordan8201

    (@jordan8201)

    I have a table with about 12 rows in it. One has a Scripture reference, one has a Scripture verse, one for each paragraph, etc.

    They are set to display on our web site each day…each day of the year corresponds with a record number in the row.

    I want to start displaying the devotions now in the WordPress page, but I don’t want to have to repaste all of them into the WordPress page one at at time. I just want to move them into the WP database if possible. It would operate the same way, where the date would need to correspond with the publish date so that it would be published on the correct day of the year.

    Thanks!

    Hi,

    Can you export a row from your the table, one is fine, so i can get a visual idea of the structure..

    Of course if you just want to move a table from “database A” to “database B”, phpmyadmin can help you do that … you don’t need a script..

    Perhaps that may be a good place to start…

    If you like, export a few rows, tell me the existing database name, and i’ll do a few tests with it on my local install…

    I think the biggest issue you’ll have is deciding when you want to pull this data into wordpress, and where… and the exact usage..

    It’s easy enough to just create a table wp_example, plonk some data in it… but then it’s just a table with data……

    Thread Starter jordan8201

    (@jordan8201)

    What would you like me to export it as? Should I email to you? I am willing to do whatever. If I cold use my table in the WP page and have it pull from my table it would be just fine with me.

    Thnks

    Are both these databases on the same server?

    If they are the quickest way to get it into your wordpress database is via PHPMYADMIN…

    Assuming you have only 1 table in the database you want to copy from..

    1. Select the database (the one you want to copy from – not the wp one)
    2. Select/Click on the table
    3. Click Operations (top right)
    4. Look for a section on the right labelled “Copy table to (database.table):”
    5. Choose the WordPress database from the drop down box (select box)
    6. In the box to the right of that, type in a name for the new table, prefixing it with the same prefix you use on your wordpress tables (by default this is “wp_” , without the quotes) … for example: wp_mytablename
    7. Select the option for “Structure and data”
    8. Click GO! (make sure it’s the one in the same boxed area)…

    You should now have the table copied to your wordpress database..

    It will show in the list of tables in the wordpress database as “wp_yourname” , where wp_ is the prefix, unless you use something else, and where yourname, is the name you choose in Step 6…

    Can you manage that ok?

    Once we’ve got the database bit out the way i can make something for pulling the data for you…

    Thread Starter jordan8201

    (@jordan8201)

    Ok that is done! So far so good…:)
    Is ther

    Good job mate, now if you’d like to export 1 or 2 rows from that table…

    Again, in PHPMYADMIN, same procedure (pretty much as before), but choose Export instead of Operations, then untick the “Save file to server” option.. .. near the bottom where you see the save options…

    If the data isn’t sensitve just open the .sql file in notepad, and copy and paste the contents into a pastebin (see link)..
    https://wordpress.pastebin.com/

    Then provide the link here… ??

    Thread Starter jordan8201

    (@jordan8201)

    Okay, that is done…here is the link:

    https://wordpress.pastebin.com/m5b0ed517

    Thanks ??

    Ok, and how do you want to interact with the entries?

    I can make a basic plugin that allows you to use a shortcode..

    Something like…

    [devotions id="123"]

    That would select the entry with the RecordNum 123….

    Of course ID can be called something else… also the shortcode to, doesn’t have to be [devotions], it could be [i like cookies] for all that it matters.. ??

    Then when you’re writing your post…

    This is some text in the post, blah blah blah… [devotions id=”1″]
    Then some more text…
    [devotions id=”2″]

    So you can just refer to which entry you need… throughout the post/page and it’ll grab the necessary entry from the database… and plonk it in the appropriate place…

    So where you see [devotions] above, will actually be the related entry from the database…

    Hows that? …

    Of course i’ll need a little time… but the above, i can do…

    Ideally you’ll need to be using a current version of WP, as i’m not use to coding for anything less then 2.7 … as such some functions i call may not exist in pre 2.7 releases..

    Thread Starter jordan8201

    (@jordan8201)

    Thank you for all of your help. I don’t think you are completely understanding. I would not actually want to interact with it at all. Devotions have been written for two years already, and someone is currently inputting them into our database. The only thing I would need is for one devotion per day to be published. All of the devotions are dated with record numbers, and we currently have a form that generates the devotion on our web page based on the record number. Record one would be January first, record 365 would be December 31, record 366 is January 1st, etc. We send these out by email also, so we will keep that form for that, but I would like to be able to do the same thing on our
    WP page, because I want to establish a blog for our pastor as well. I hope this makes sense! I just installed WP, so I would think I would have the newest version.

    Thanks,

    Ok, well if you have a page that generates them, and someone that inputs the data for you, then i can’t see what it is you want to do…. ??

    Do you just want something that pulls the data, but onto a wordpress page?

    Or a page that pulls an entry relevant to the day of the year?…

    Any chance i can see the current page for the devotions and the page you want them on? … perhaps to give me a clearer idea.. ??

    Thread Starter jordan8201

    (@jordan8201)

    Sure! ?? This is the current devotion page:
    https://mzbc.com/devotions/

    I have never cared for the way the text looks on this page, but it is all done for us with a form (I can show that you that if you would like).

    Our pastor is going to start an occasional blog, and I would like to use the new blog page for the devotions, so I would need to somehow tell WP how to do what our other page is currently doing.

    Thanks again!

    So basically the page currently selects an entry to match the day of the year? Is that correct?

    I can mimic that no problem…

    If you want something for managing the entries, i can hook it into the WP admin section. That may be more secure then your current form… it’s impossible to say without seeing your current script..

    And certainly curious to see the current form you mentioned…

    Thread Starter jordan8201

    (@jordan8201)

    That is correct. THe link below is the page source. I didn’t write the code, a friend of mine did, but it works great. I just want to use the same page for this as we will for the blog, and I like the WP page better.

    Again, I appreciate it.

    Thread Starter jordan8201

    (@jordan8201)

    Ooops, here is the link ??
    https://wordpress.pastebin.com/d5b8f9c6e

Viewing 15 replies - 1 through 15 (of 97 total)
  • The topic ‘Merging from another database’ is closed to new replies.