Retrieve WordPress database table names and print them out

Simply we can retrieve table names from WordPress database.

$sql = "SHOW TABLES LIKE '%'";
$results = $wpdb->get_results($sql);

foreach($results as $index => $value) {
    foreach($value as $tableName) {
        echo $tableName . '<br />';

The => will separate the key and value from a multidimensional array.
Happy Coding!

We will be happy to hear your thoughts

Leave a reply

Register New Account
Reset Password