tags:

views:

15

answers:

1

Is there a function or command that pulls the db connection info from the WP blog? I am writing a Plugin which would have to connect to the db to retrieve the info, wondering if there was one single command/function i could call which could connect. this would make the plugin portable and would work on any WP blog. is this possible?

A: 

See the Interfacing with the Database docs.

You should just be able to use the global (curse you, Wordpress) variable $wpdb in your plugin functions, ie:

global $wpdb;
//do stuff

Plugins also have a few methods for storing "options" in the database. I just found this article, it details things fairly well.

zombat
lol one time a global var is awesome
HollerTrain
Wordpress is all global variables unfortunately. It causes a lot of problems if you get into anything more than the simplest custom development :(
zombat