I am trying to display all table names in my database. This is my code:
<?php
define('DB_HOST', 'localhost');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', '');
define('DB_NAME', 'nucleus');
$db=new mysqli(DB_HOST,DB_USERNAME,DB_PASSWORD,DB_NAME);
$query = $db->prepare('SHOW TABLES FROM `nucleus`');
$query->execute();
while($rows = $query->fetch()){
echo " $rows";
}
?>
All it is displaying 1 for every entry, I don't know why. Any solution for this?