Created
February 14, 2014 22:52
-
-
Save bruno-barros/9011225 to your computer and use it in GitHub Desktop.
access another database from Wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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