Ideas to connect external database table to wordpress posts as custom field source

I have a custom database table within wordpress database.. I filled this database with data and wordpress posts table with matching ids

an example would be...

wp-posts table has

    id - title
    1  - record1 title
    2  - record2 title

custom table has

    id - title          - data1 - data2 - data3
    1  - record1 title  - 20g   - good  - 200USD
    2  - record2 title  - 30g   - fine  - 100USD

I can reach data with custom php coding and sql queries when i open a post

lets say if i go www.demo.com?p=2 I can display,

Title - record2 **with the_title()**
details - 30g - good - 200USD **with php+mysql**

what i want to do is connect them with custom fileds so that i will be able to edit them in backend and display them more easily without writing custom php+mysql coding..

I checked ACF and several custom field plugins.. they seem to create their own tables or store data in postmeta

This wont work with me since i am using this external table with other php coding other than wp.

I looked at some frameworks also.. Couldnt find the best answer yet..

since i have same id's for wordpress posts and custom tables records is there an easy way to do it without writing code.. Or less coding..

Thanx

Topic framework custom-field database custom-post-types Wordpress

Category Web


After long searches and tries I ended up with "Pods Framework".

It gives me a choice to store my custom field values to a custom table within wordpress database.

Now i am able to query them with other sources (such as other web apps that shares the same database).


There are filters in get_metadata() and WP_Query that you can use to alter the SQL, but I am sure that is not an exhaustive list of the filters that you would need to worry about. What you are attempting, or seem to be attempting, is a big project. Be warned. And it is much to big to tackle here from scratch.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.