Home website design new york | Free Quote website design new york | Call Now 646.657.9323 website design new york
Royal Deer Design, Web Design New York City. We are a web design and internet marketing company located in New York City
Wednesday January 18, 2012, 13:14

Connecting to External Database in WordPress

This is possible to use the wpdb object to access any external database and query any table within your WordPress installation. You can even use all the wpdb classes and functions such as get_results.

Example:


$my_external_db = new wpdb('username','password','database','localhost');

$rows = $mydb->get_results("SELECT * from MYTABLE ");

foreach ($rows as $result) :

echo $ result ->Title;

endforeach;







Connecting to External Database in WordPress

, created on Wednesday January 18, 2012, 13:14, article tagged with keywords: wordpress, database, coding,
Tags: wordpress, database, coding,

Connecting to External Database in WordPress

, related articles:
ARCHIVE


Categories:



--


Our Tweets
blue dot #SSL Certificate 101 http://t.co/CYwZIhvP
5:58pm January 16, 2012

blue dot The real you http://t.co/OXqjk2Pk
6:42am January 12, 2012

blue dot 7 Billion People Today http://t.co/C8sVF9Rx
8:15pm January 10, 2012

blue dot #WordPress for small #business #websites http://t.co/MUNTaw8B
9:28pm January 8, 2012


blue dot follow us on twitter