When you are working on WordPress development (theme deelopment or plugin development), probably you will need to retrieve current website database name, database user and password. To get those information you can write these lines on your theme/plugin:
global $wpdb;
echo $wpdb->dbname;
echo $wpdb->dbuser;
echo $wpdb->dbpassword;
The last three lines will echo the database name, username and password.
Hope that’s helpful.
loading...