Playing around with the query SHOW TABLE STATUS in a non-WordPress core/plugin/template file using wp-load.php to access WordPress functions and database connection.
require_once('wp-load.php');
function mysqlInfo() {
$info = $wpdb->get_results('SHOW TABLE STATUS');
foreach($info as $table) {
echo $table->name;
}
}
I keep running into this error:
Fatal error: Call to a member function get_results() on a non-object in /../../../file.php
I have tried declaring $wpdb as a global variable and tried creating a new class out of $wpdb
You have to declare the global variable within the function