You are currently browsing comments. If you would like to return to the full story, you can read the full entry here: “Using the WordPress database outside WordPress in version 3.4+”.
You are currently browsing comments. If you would like to return to the full story, you can read the full entry here: “Using the WordPress database outside WordPress in version 3.4+”.
Nice, it’s just what I have been looking for. Works with 3.5 WP. Tnx 😉
Thank you so much. Super helpful.
Perfect. Moving my site to WordPress but have had a heck of a time using my external mySQL database that I need. This was the final piece.
your tut assumes my wp installation is in server root. what if i have wp installed in example.com/blog/ ?
Just edit the require line.
require_once( $_SERVER[‘DOCUMENT_ROOT’] . ‘/blog/wp-load.php’ );
Cool! thanks, but;
few stupid questions:
What is ‘DOCUMENT_ROOT’? The php file? The site domain?
Do I still need to use $wpdb prefix?
Do I can use ordinary sql syntax or need wp api?
Thnks,
Still works great in 3.9.1. Thanks!