• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get db name

#1
hi sorry for english , there is a way to get db name ? 

i have this code to get db table :

Code:
           $db = \Config\Database::connect();

        $tableList = array();


        $query = $db->query("SHOW TABLES");
        $results = $query->getResult();

        foreach ($results as $row)
        {
           $tableList[] =$row->Tables_in_name_of_db;
        }

          $data['tableList']= $tableList;


Can i get the name to use in this method ? i know that db name are in .env but i want create a tool and i must get it
Reply


Messages In This Thread
Get db name - by pippuccio76 - 04-05-2021, 07:12 AM
RE: Get db name - by InsiteFX - 04-05-2021, 10:49 AM
RE: Get db name - by nfaiz - 04-05-2021, 05:52 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.