I had a problem with my single webpage. I want to display some infos from a database. So, I made the connection and then I wrote the HTML so that they will be displayed, but when I run that in my website, the only thing that is displayed, is a blank white page.
My PHP code is:
<?php
$query = "SELECT * FROM `test_database` WHERE subcategory='number'";
$show_id = filterTable($query);
$query_num_rows = mysql_num_rows($query_run);
if ($query_num_rows >= 1 ) {
echo $query_num_rows.' results found:<br>';
}
} else {
echo 'no result';
}
// function to connect and execute the query
function filterTable($query)
{
$connect = mysqli_connect("host", "user", "pas", "table");
$filter_Result = mysqli_query($connect, $query);
return $filter_Result;
}
?>
And the HTML:
<!DOCTYPE html>
<head>
</head>
<body>
<?php while($row = mysqli_fetch_array($show_id)):?>
<!-- Trigger/Open The Modal -->
<div class="center">
<button id="myBtn">
<span><?php echo $row['id'];?></span>
<?php endwhile;?>
</button>
</div>
</body>
</html>