Getting the $wpdb from any PHP file

Good way to load WordPress in any PHP file:

set_time_limit ( 0 );

ini_set ( 'max_execution_time', 0 );

ini_set ( 'display_errors', 1 );

ini_set ( 'display_startup_errors', 1 );

error_reporting ( - 1 );



require_once (dirname ( __FILE__ ) . "/wp-load.php");



global $wpdb;



tags: & category: -