Include WordPress Functions in Stand Alone Script

//Add to be able to access wordpress functions in standalone scripts
define( 'WP_USE_THEMES', false );
require_once( $_SERVER[ 'DOCUMENT_ROOT' ] . '/wp-load.php' ); //this gives you access to the wordpress functions
global $wpdb; // this is how you get access to the database