Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mustafauysal
Created February 24, 2019 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mustafauysal/b22476e2bcb4f0165cacf43e8968d7e7 to your computer and use it in GitHub Desktop.
Save mustafauysal/b22476e2bcb4f0165cacf43e8968d7e7 to your computer and use it in GitHub Desktop.
different dataset for table
<?php
$wpdb->add_database( array(
'host' => 'global.db.example.com',
'user' => 'globaluser',
'password' => 'globalpassword',
'name' => 'globaldb',
) );
$wpdb->add_database( array(
'host' => '192.168.1.5',
'user' => DB_USER,
'password' => DB_PASSWORD,
'name' => 'mycustomdatabase',
'write' => 1,
'read' => 1,
'dataset' => 'customdataset',
'timeout' => 0.5,
) );
$wpdb->add_table( 'customdataset', 'wp_my_custom_table' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment