/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $wpdbtest_otherdb = new wpdb('db_user', 'db_password', 'db_name', 'localhost'); $wpdbtest_otherdb->show_errors(); $datarows = $wpdbtest_otherdb->get_results("SELECT field,field2,field3 FROM table"); foreach ($datarows as $datarow) { echo $datarow->field; } ?>