WP function to fetch database connection

Is there a function or command that fetches db connection information from WP blog? I am writing a plugin that would have to connect to a db to fetch information, wondering if there is one single command / function I could call that could connect. this will make the plugin portable and will work on any WP blog. is it possible?

+2


a source to share


1 answer


See Interacting with Databases .

You can just use a global variable (damn, Wordpress) $wpdb

in your plugin functions, i.e .:



global $wpdb;
//do stuff

      

Plugins also have several methods for storing "options" in the database. I just found in this article , it describes the situation in detail.

+2


a source







All Articles