How to access WP database inside ipn.php? [duplicate]

Try adding this to the top of your script:

require('/path/to/httpdocs/wp-blog-header.php'); 
global $wpdb;

Then you can run queries using:

$sql = "Your SQL Query Here";
$wpdb->get_results($sql)

techhipbettruvabetnorabahisbahis forumuedusedusedueduedusedueduseduseduedu