<?php
$connessione = mysqli_connect("localhost","root","","my_db");
$query = mysqli_query($connessione,"SHOW TABLES");
$array=mysqli_fetch_array($query);
print_r($array,1);
?>
Printing all tables in my_db.
The code returns an empty page.
error_reporting(E_ALL);
at the top of the page, but it doesn't return nothing; SHOW TABLES
using phpMyAdmin and it works as it should. How can I fix my code?
Here's what you need to do:
<?php
$connessione = mysqli_connect("localhost","root","","my_db");
$query = mysqli_query($connessione,"SHOW TABLES");
while($row = mysqli_fetch_array($query)){
print_r($row);
}
?>
See here for a description of what mysqli_fetch_array
actually does.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.