wordpress site – using custom database and PHP

Since we do not know how the data should be represented on the ‘front-end’ (read WP install), it is hard to say. You could convert the existing database to use custom tables. Create a small REST(1) JSON/XML(1) API(1) on the ‘other’ application. Then code a WordPress plugin that shows the data from the API with … Read more

Storing The Data Collected by Ninja Forms into Another (custom) Database [closed]

The data is stored in the wp_posts and wp_postmeta tables. You can see all the field values by doing this: SELECT website from (SELECT m1.meta_value as user_firstname, m2.meta_value as user_lastname, m3.meta_value as website FROM dev_posts join dev_postmeta m1 on m1.post_id = ID and m1.meta_key = ‘_field_1’ join dev_postmeta m2 on m2.post_id = ID and m2.meta_key … Read more

Location of image metadata on my server

The image url is store in wp_posts as an attachment post_type with their corresponding posts(s) as parents. From Codex, see Template Tags Show All Attachments I believe something like this would retrieve all attachments in DB outside of a loop: global $post; $args = array( ‘post_type’ => ‘attachment’, ‘posts_per_page’ => -1, ‘post_status’ => ‘any’, ‘post_parent’ … Read more

Stringing together content from different databases

If the content to import is in another database that you have access to (via custom programming), then it is technically possible to extract data from the source database and create pages/posts from that data/content into your WP site. See my answer to Automating Page Creation . The link to https://developer.wordpress.org/reference/functions/wp_insert_post/ contains the WP code … Read more

How can I detect right db type?

wpdb->dbh is declared as protected property, you should not even have access to it, unless you are subclassing wpdb? The only public property is wpdb->is_mysql which is just hardcoded for true and meant for detection of non–native database drop–ins. So overall wpdb context is meant to be internal, you set up the connection and let … Read more