上QQ阅读APP看书,第一时间看更新
Querying the database
As with most frameworks, WordPress provides a built-in interface for interacting with the database. Most of the database operations will be handled by the wpdb class located inside the wp-includes directory. The wpdb class will be available inside your plugins and themes as a global variable and provides access to all the tables inside the WordPress database, including custom tables.
Using the wpdb class for CRUD operations is straightforward with its built-in methods. A complete guide for using the wpdb class can be found at http://codex.wordpress.org/Class_Reference/wpdb.