My code is given below. In which I can only print the table headings. I want the table whose name I entered in the database should show the entire table.
<?php
$dataconn = mysqli_connect("localhost", "root", "", "databasename");
$sql = "SELECT * FROM employeedetails";
$res = mysqli_query($dataconn, $sql);
$show = mysqli_fetch_all($res, MYSQLI_ASSOC);
$col = $show[0];
$columns = array();
echo "<pre>";
foreach ($col as $key => $value) {
if (is_string($key)) {
$columns[] = $key;
}
}
echo "<table border='1' cellpadding='10'>";
foreach ($columns as $value) {
echo "<th>$value</th>";
}
for ($x = 0; $x < count($show); $x++) {
echo "$value";
}