Copying post_title to a wp_key in myPHPadmin

Not sure if this is possible or that this is the best place to ask, but worth a try, I am not very experienced with myPHPadmin, I have managed to change/update custom field names, but I would like to copy and/or duplicate the post_title of the custom post to a custom field value.

I have used the following (successfully) to replace a custom field name:

UPDATE "wp_postmeta"
SET "meta_key" = replace(meta_key, "OLD-CUSTOM-NAME", "NEW-CUSTOM-NAME"")

But I am not clear on how to copy the post_title from another table to replace a current available custom post value, does anybody know the code needed?

I hope that makes sense, thank you in advance!

  • aristath
    • Recruit

    Hello again @James,

    I would advise against directly editing the database.

    Perhaps if you tell us exactly what you wan to do we can help you custom-code this in PHP as a custom plugin...

    What is your goal? And why do you want to use custom tables in your db? Could you please elaborate?

    Please advise,
    Ari.

  • James
    • Design Lord, Child of Thor

    Hey Ari,

    I am trying to pull a custom post name outside of the custom post loop, the problem is there are over 1,000 of them (tricker happy client), I can pull all the custom fields fine at the moment, but not the post titles, there is a field name and its value available on all the custom posts, so if I can copy the post titles into the available field then happy days.

    I have a database to play with at the moment in case of mistakes.

    Does that make sense?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.