I want to use AJAX in my plugin. I've got a JavaScript function setup to call a PHP file; the PHP file queries the DB for the info and returns it to the JS file, which updates the page. I think that is the standard method for doing this sort of thing.
The problem with trying to do it in WordPress, though, is that I either need to access $wpdb or create me own DB connection. I'd like to use $wpdb for obvious reasons, but how? The PHP file isn't intergrated into wordpress.
The other option is creating my own DB connection, but then I have to either manually enter the DB info in my plugin or grab it from wpconfig.php (http://wordpress.org/support/topic/32036?replies=16), which is fairly unelegant.
I'm sure lots of people have run into this before, are there any good solutions?