You can easily connect to another DB using the wpdb
class: $external_users_db = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
(substituting in your applicable values, of course).
From there you can use the get_results
, insert
, update
, and query
methods (among others) to do what you need to do, e.g. $external_users_db->get_results( "SELECT ID, username FROM users" );
.
The Codex has pretty thorough information: http://codex.wordpress.org/Class_Reference/wpdb
Related Posts:
- Custom form that store input in database
- Insert data in database using form
- Inserting data into custom tables
- Storing textbox values in Database
- Store and Encrypt Contact Form 7 Submissions in Database? [closed]
- Form Data not getting stored in WordPress database
- Sending data with multi step form to wp database
- Retrieve data from the database to table such as comments in the admin control panel
- WordPress running SQL query to update database from form
- Form that sends data to an admin panel and can export it
- Insert Query not working in the form
- Using $wpdb | checking entered email against existing emails in db
- Storing user submitted forms [closed]
- Getting value from database table depending on field value
- Whats the best practise on how to store json data from a custom settings page?
- How to edit custom table data in frontend
- User input to database
- Creating a custom form with ability to query and submit to SQL
- Change user_nickname for author page link
- Insert variables into wpdb in custom post template
- Getting values from form and saving in database but spaces are inserted instead of form values
- Help posting values to DB on submit using $wpdb->query
- Select data from foreach loop and send it to wordpress database
- insert data from a form:: Warning Empty query mysqli::query()
- Form display in new page
- $wpdb not working
- Auto populate form fields based on serial input or pull listings from other websites?
- Simple email input store in database
- User accounts for saving form data?
- Insert Extra fields added in the front end registration form to DB
- Creating Job Tickets
- Saving data to database and exporting to excel
- wp_usermeta key problem
- Is it possible to have a form page for logged-out users where values are stored persistently?
- What is this JavaScript “require”?
- How can I make updates to a site, on a development copy, but then move updates back without overriding live site’s evolving database?
- get_results using wpdb
- wpdb->insert multiple record at once
- How to migrate a HTTPS WordPress installation to localhost?
- How does $wpdb handle COUNT(*)
- How to reset the post ID increment
- Shared Members between two different wordpress installations with different databases
- Efficiency on displaying random authors based on large database
- How to write Hebrew characters?
- Error establishing a database connection – with Debug Data
- Finding the login page from database?
- How to execute mulitple statement SQL queries using $wpdb->query?
- When and why should I use $wpdb different return types?
- Database with mixed collation (utf8mb4 & utf8_general_ci)
- WordPress database growing dramatically in size despite adding no new content
- Clean database from unused tables
- How wordpress accesses its own database
- Migrating database / content of non-CMS site to WordPress
- Delete all post meta except featured image Using SQL
- How to interact with another wordpress install on same database?
- Saving into post_excerpt or post_content
- Maintain user profile data in a non-WordPress database
- How to scan barcode and store data into a database [closed]
- Fetching values from database for select box
- Setup private content for specific users with daily updates [closed]
- Connection refused on locahost after importing database?
- When to use custom DB tables or add_option?
- creating new field on mysql
- Does WordPress store the username as a primary key in the database?
- WSOD 3.9.1 – Tried Everything so far
- Database Update Required – Update from command-line
- Problem migrating to localhost
- SQL query to set posts in bulk based on the post content
- Automate WordPress website setup with prefilled data
- Storing The Data Collected by Ninja Forms into Another (custom) Database [closed]
- Custom search query by category id
- How do you render posts from outside wordpress?
- Image link issues after importing a database backup to my local web server
- multiple wordpress installs w/shared user database but separate content databases
- Second ezSQL initialization for MSSQL
- Fetch a single row from a custom table for to a given ID
- Database create or redirect
- Updating seperate database when post attachment is changed
- Database structure cheatsheet
- WordPress Database – wp_usermeta and the correct number of session_tokens rows
- How to escape percentage sign(%) in sql query with $wpdb->prepare?
- How to get a list of articles related to a particular category from my other WordPress website?
- A WP dev site that displays content from a live site’s database but cannot write to wp_posts?
- error establishing database connection (WAMP + filezilla)
- Is there a way for two deferent themes to consume two different DB on a same WP instance?
- Insert data from form to database
- How do I update a WordPress wp_postmeta meta_value that contains many options
- How can I get $wpdb to show MySQL warnings?
- How to extract some part of WordPress full source code
- Error establishing a database connection for some files
- Hash user emails in database?
- Weird characters in title if it contain “ ”
- DB access blocked when initializing WP externally
- Site does not work right, pages not showing up, even for root admin
- One information repeated on multiple locations on one site [closed]
- WordPress: Interact with Database Query Data and Login
- Showing Error(TAble already exist)
- Getting an error when trying to migrate to DV server from Grid with Media Temple [closed]
- Cant Connect to Database
- Can’t insert into a database wordpress