WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/require wp db

Description

Load the correct database class file.

This function is used to load the database class file either at runtime or by wp-admin/setup-config.php We must globalise $wpdb to ensure that it is defined globally by the inline code in wp-db.php.

Usage

<?php require_wp_db() ?>

Parameters

None.

Return Values

(void) 
This function does not return a value.

Examples

Notes

  • Uses global: (object) $wpdb

Change Log

Since: 2.5.0

Source File

require_wp_db() is located in /wp-includes/load.php.

Related