Skip to content

Instantly share code, notes, and snippets.

@bruno-barros
Created February 14, 2014 22:52
Show Gist options
  • Save bruno-barros/9011225 to your computer and use it in GitHub Desktop.
Save bruno-barros/9011225 to your computer and use it in GitHub Desktop.
access another database from Wordpress
$newdb = new wpdb('root', '', 'sig001', 'localhost');
$l = $newdb->get_results("SELECT * FROM sig_contents WHERE content_type = 'sigsystem' ORDER BY title");
d($newdb->show_errors());
if($l){
foreach($l as $r){
d($r->title);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment