0

hy everyone, can I get list of databases name in mysql server on codeigniter3 I have tried this codeigniter3 query code but still not worked:

$databases = $this->db->query('show databases');

I also tried with php code not worked

$db_conn = mysqli_connect('localhost', 'root', '');
$databases = mysqli_query($db_conn,"SHOW DATABASES");
arjilm
  • 71
  • 2
  • 6

1 Answers1

0

We can easily fetch the all database related information in codeigniter by:-

Just use below code:-

print_r($this->db);

Just Only fetch the database name then:-

echo $this->db->database;  
KUMAR
  • 1,993
  • 2
  • 9
  • 26