You can create a new wpdb object, and then use that.
global $mydb;
$mydb = new wpdb( $db_user, $db_pass, $db_name, $db_host );
…and then use $mydb as you would the global $wpdb object.
Related Posts:
- How do I make an HTML table from a database table?
- Inserting dynamic content into a page
- Check if post of title already exists
- $wpdb->delete column values IN ARRAY()?
- Does WordPress cache get_user_meta() results?
- Export User Info to CSV from Front End
- WordPress admin never finishes saving page on site with large page count
- Retrieving and Displaying Data From a Table
- Refresh page after update_post_meta
- Search and Replace in database: How to replace data in SQL dump file on Windows?
- error importing localhost export file to server
- Would manually deleting the dumping data fix a “#1062 – Duplicate entry ‘1’ for key ‘PRIMARY'” phpMyAdmin error?
- How to sort results from a custom database table
- Why WordPress uses 4 tables to manage terms
- WP database error for comments_popup_link()
- No wp-config.php file on local install of wordpress – site still displays
- How to create Sub Sub domain Multi User blogs?
- How to find the output of contact form 7 shortcode? [closed]
- Issue with foreach on duplicate meta_key’s
- Different database query in function.php using mysqli
- How to generate page content from database the right way?
- Proper way to edit a post via phpMyAdmin without breaking the compare revisions tool
- Store and Work with huge array in WP [closed]
- Adding Custom Forms
- Why is the post meta[] empty when I make a call to the wordpress rest api?
- Is it necessary to sanitize wp_set_password user input?
- database interactions using OOP
- Accessing the database from a plugin outside of action hooks
- Trying to establish connection to External Database
- Create WP_Query to search for posts by their categories or their parent/child categories
- How to save checkbox values for logged in users?
- Update results, Before deleting the related category [closed]
- How WordPress reacts to a lack of memory of the server [closed]
- Split reads to a different connection string
- custom user role wordpress – grant guest access to edit.php without insert/update/delete
- Execute long and heavy processes
- database sent to a JSON file
- inserting a post from an extern php file but post content doesn’t show on wp site
- Databases – Submitting data from inputs to database [closed]
- db converts decimal number wrong
- Filtering a Database Query
- Is it best to avoid using $wpdb for security issues?
- Blob file download problem
- wpdb prepare insert table doesn’t work
- Should I use WordPress to skin a database website?
- Creating Database Table vs. Adding MetaData to Post & User
- How can I find the cause of a 500 server error?
- I can’t update my data through $wpdb
- Can’t successfully check if post with title exist in database
- Cant connect to database with php 7.3
- Lost in trying to create user database system
- Delete database record using plugin from admin panel
- How to get image from url from the database?
- Wpdb get->results to out the the month from the db
- Filter results from a serialized string to use on statistics
- How to add data to a custom field at the wp_users table?
- Creating custom page template from existing PHP site
- wordpress site – using custom database and PHP
- phpMyAdmin error #1062 – Duplicate entry ‘1’ for key ‘PRIMARY’
- Using PHP Code Snippets to query a database, $dbconnection->get_results is outputting nothing
- Database entry removed on browser refresh, Ajax PHP jQuery
- Change wordpress’ database data using ajax – how to get current user id?
- Error establishing a database connection (Set-up locally)
- add role on WordPress in PHP on a second database
- Create a new account on site B with data from the purchase of site A
- How to search order using database frontend short code WordPress
- Limiting posts based on nested meta_query
- Preserving backslashes in post_content
- PHP Warning: mysqli_query(): after updating my websites php from 5.6 to 7.2
- Unable to insert two value in two different columns (WordPress database)
- Retrieving and Displaying Data From a Table
- why not selecting multiple rows of same standard_id using SQL query from database?
- Using custom php to connect to database blocks wp from accessing galery pictures
- Can I disable auto increment of WordPress Posts Database to utilize previously deleted records?
- Updating the database after parsing CSV document
- getting the values of hidden inputs to use them in a php mysql query
- How to display post_content from database in different on template page?
- Front end/Database connection in WP
- Issue in url update when using wordpress update query
- direct query to post_meta table
- can’t delete a row from post_meta table
- special characters not supporting in wordpress
- How to fetch results from database
- How to connect database table to each registered wordpress user.
- Let users register weight each day and save it in DB
- Trying to post information from a remote database to wordpress page
- Query specific posts per user selections from dropdown menus
- Create an unique ID number after submit form
- Fetching wpdb data from a php file seems to break?
- PHP Call to External Database
- How do I empty a specific meta_value for all users in PHP
- Create custom table for wordpress custom registration flow
- Custom form that stores data in mysql database
- How to get data (not value or name) from radio options to POST to database
- Creating a table via dbDelta
- Retrieve data from external database and insert back in
- How to get the last date updated of postmeta?
- Putting form result in my database
- Issue with WordPress Plugin Activation Hook and Table Creation
- Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder