Created
February 13, 2018 03:52
-
-
Save malikkurosaki/c0f3d431be38788f25639e4be0c477be to your computer and use it in GitHub Desktop.
show all table name from database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
requere("../core/connaect.php"); // connetion of database "host,user,pass,db" wrap as $con; | |
$query = "SHOW TABLES FROM mydb"; // the query | |
$result = mysqli_query($con,$query); // check is database have table | |
if($result){ | |
echo "ok"; | |
$rows = mysqli_fetch_all($result); // fetch all | |
print_r($rows); //output name of tables | |
}else{ | |
echo $con->error; | |
} | |
$con->close(); // close connection from database | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment