I have been searching for an answer to this question for over a month now – i do not think wordpress is very good for any site that has a secure external DB or for anyone who does not want to store customer data in the main wordpress database, which is strange as that seems like a highly valued function.
At any rate i came across this code during my research that may help you – it is a global variable for a external DB… according to the author it is usable in the same way as $wpdb global variable is used.
If you want the author’s full blurb on it go here https://bavotasan.com/2011/access-another-database-in-wordpress/
The code is:
$newdb = new wpdb($DB_USER, $DB_PASSWORD, $DB_NAME, $DB_HOST);
$newdb->show_errors();
Hopefully it is of some use to you…
Related Posts:
- wpdb custom post_type problem
- Does this archive template part look like its making too many calls to the db?
- How to store additional data that is related to core data
- Shared Custom post type between WP network sites
- Should I use custom post types or a custom database tables for plugin development?
- Custom Post Types, or completely custom?
- Right way of storing large number of custom post fields
- How to use custom database tables for custom post types?
- Custom Post Type or Custom Tables
- Create Pages from Database
- Use Custom Database with Custom Post Type
- Custom Search | Wrong output & question
- Save or update data when custom post published
- Custom post type Vs. data in own table
- $wpdb returns no results with SELECT query on custom post type, works on default post type
- Save custom post type in different table
- Using posts and postmeta table to store custom Address Book Plugin data
- using custom taxonomies on non wp table?
- Developing WordPress on Kubernetes
- Recommended custom post type structure for TV Schedule site?
- How to best delete orphan wp_postmeta
- Where to store custom tagging data associated with a custom post type
- $wpdb: Counting posts corresponding to 3 terms in 3 different taxonomies
- WP All Import – Using Xpath to set a select value
- Insert post metadata for all posts in CPT at once if metadata no existent
- Sorting custom post type columns with external data and without meta values
- Convert simple SQL Query to WordPress query
- Add meta value to custom post type on publish
- convert custom query to wp_query
- using $wpdb to get custom post type with term
- How to use custom taxonomies to reference complex relationships?
- Create a clone from one WordPress site to another in a few minutes
- Database to page routing API?
- Store CPT ‘Reviews’ average ratings to a WordPress DB table or to a DB custom table?
- How to change wp prefix for custom post type only?
- Is it possible to store Custom Post Type data in separate set of tables and still have wp_post class functionality?
- Add update or delete database records using custom post type
- How to import a custom MySQL DB table into a WordPress custom post type
- WP_Query orderby and tax_query
- How to organise this data within WordPress
- Organize WordPress site, so it can maintain with huge database
- Show data from one Custom Post Type in another Custom Post Type
- Specifying meta field’s column type in Database using add_post_meta
- Replace dynamically content in a custom database table when a custom post is created
- Running a song lyrics site on WordPress
- Save and user submitted data from a form and display them in the wp backend
- Should I use custom taxonomies or not?
- $wpdb->get_col and ORDER BY?
- Designing a custom post type with a minimum number of meta fields
- Allow front end users to add data to a custom post type
- WordPress hook which triggers on post import
- Update all published posts at once
- Entity to store contact form entries?
- Ideas to connect external database table to wordpress posts as custom field source
- Database alteration: users who voted
- WordPress as a frontend website for iOS app [closed]
- foreach loop inside the loop creating duplicates in output
- delete duplicate meta_value with same post_id
- custom post type: own database table structure and custom “new-post” interface
- Import External XML
- Say I have a tech blog, how best would I store technical specs for a phone, if i use custom post types
- How do you make relational post types in WordPress? [duplicate]
- Having a repeating custom field in admin custom post type, what I’d go better with, for DB’s sake? ACF repeater or query a different post type?
- See if the email exists or not
- How to select custom posts thats are tagged with multiple taxonomies using wpdb
- Right way to store a large set of similar information on website? [duplicate]
- Filter in Custom post type to find the parent post
- Custom post type and custom taxonomy key lenght & query performance
- How select query is generated in a Custom Post Type?
- dynamic vue widget inside custom post
- Create 3 Levels of relations with WordPress
- Update 2 wordpress tables at once
- Event Manager: Events Deleted are still in DB as published but hidden in admin
- Changing an item in drop down after 5 latest posts per taxonomy
- How to use costum database table for custom post type
- Populate custom post type/custom fields from an external database
- Limit Number of Custom Post Type Dashboard
- Automatically convert standard posts with custom fields to custom post types
- In WordPress do I create tables for my plugin or do I create custom post types for a Student and Classes Registration system?
- Custom Post save causes 500 error
- How to enable the user to add value through the admin panel?
- Custom Post Types and Posts are mixed
- Pulling Content from Existing Database
- Query Distinct Taxonomies of Custom Post Type
- Displaying database table in backend of wordpress
- custom post type for custom talbe
- Adapting plugin for custom post type?
- Retrieve post data via WPDB class
- Check in function on custom page
- Most efficient way of deleting post
- Problem with menu categories doubling up when updating database?
- Saving custom metabox data with a twist
- Inserting into WP DB
- Save number of Facebook likes to database
- Switched server & domain name, now custom post types won’t save
- custom post types containing a collection of items
- Why WordPress does not Use Separate Table for Post Types (When Registring)?
- Remote database access on another wordpress site’s custom post type
- What would be the optimal CPT / Taxonomy design for the following entities structure
- Should I save user cookie consent in a custom post type or make a custom database table?