I want to get the name of the WordPress database. I am also trying to get the database name from $wpdb , but failed. When you print $ wpdb, it gives an array of objects, but I don't know how to get the database name from an array of objects.
$wpdb
you can get your db name anywhere using
<?php echo DB_NAME; ?> <?php echo DB_USER; ?>
or
To get the db name with $ wpdb:
global $wpdb; echo $wpdb->dbname;
It will return the database name as a string.
You can get the database name by the constant DB_NAME. You can check by printing it
<?php echo DB_NAME; ?>
Source: https://habr.com/ru/post/970157/More articles:Decltype specifier assignment - c ++Is there a way to pass scope to the templateUrl: function directive? - angularjshttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/970154/should-repositories-be-properties-on-the-unit-of-work-when-using-entity-framework&usg=ALkJrhgd7lFa5ZLRv7HkIij9K9bxdGnQaQZero initialization of an array data element in the constructor - c ++Providing a dynamic role in asp.net mvc (Roles are not fixed. Updates are ongoing) - asp.netUpstream files using Google Cloud Messaging (XMPP) cloud server - androidHow to taunt / set the system date in pytest? - pythonSaving the query result in a variable - variablesUsing / Using Partial Speech Tags (POS Labeling) - nlphttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/970162/android-new-bitmapdrawable-deprecated-alternative-bitmapcreatebitmap-has-to-have-wh-0&usg=ALkJrhjQl_9vSYv9whmGJjeiGJ-XA3OCyAAll Articles