Table of Contents
WordPress provides a global object, $wpdb
, which is an instantiation of the wpdb class. By default, $wpdb
is instantiated to talk to the WordPress database.
The recommended way to access $wpdb
in your WordPress PHP code is to declare $wpdb
as a global variable using the global
keyword, like this: