Viewing 3 replies - 1 through 3 (of 3 total)
  • Reüel

    (@pronamic_reuel)

    I don’t think I fully understand your question, what exactly do you mean by “related company database” or what are you trying to accomplish?

    The meta data is indeed saved as post meta, and thus can be found in the wp_postmeta database table.

    To get the post meta for a given company post ID in your theme:
    <?php $meta = get_post_meta( [the company post ID ] ); ?>

    To get the Orbis post meta for a given company post ID in plain SQL:
    SELECT * FROM wp_postmeta WHERE post_id=[the company post ID] AND meta_key LIKE '_orbis_%'

    To get the Orbis post meta for a given Orbis ID (as mentioned in the WordPress dashboard) in plain SQL:
    SELECT m.* FROM wp_postmeta AS m LEFT JOIN wp_postmeta AS orbis ON m.post_id=orbis.post_id WHERE orbis.meta_key='_orbis_company_id' AND m.meta_key LIKE '_orbis_%' AND orbis.meta_value=[the Orbis ID]

    Thread Starter Dave3o3

    (@dave3o3)

    Hi,

    thanks for replying.

    No, thats actually the way to GET or READ the linked meta data.
    But i’m looking for a way to WRITE the meta data like kvk-number or address into the company table.
    Actually the name, the orbis ID and the e-mail are written into the table wp_orbis_companies. I want the other fields also to be written into that table; linked to the orbis ID.

    Plugin Author Remco Tolsma

    (@remcotolsma)

    Why do you want to store the KVK-number in the companies table? We have plans to narrow down the custom companies table. Currently only the company name is synced to the companies table. You can find the related code here: https://github.com/wp-orbis/wp-orbis/blob/1.3.2/includes/companies.php#L105-L134.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘SQL structure’ is closed to new replies.