1
Good morning, I want that in the following code SQL returns from the database the values "id_Admin", "username_Admin", "password_Admin", but does not return anything despite not giving any errors.
<?php
$servername = "localhost";
$username = "root";
$password = "";
$db = "aeac";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $db);
// Check connection
if(mysqli_connect_errno()){
die("connection failed: "
. mysqli_connect_error()
. " (" . mysqli_connect_errno()
. ")");
}
//get results from database
$result = mysqli_query($conn, "SELECT * FROM admin");
echo "<table id='tableId' align='center' style='width:60%; height:5%'>
<tr>
<th>ID</th>
<th>Nome</th>
<th>Password</th>
</tr>";
while ($property = mysqli_fetch_array($result));
{
echo "<tr>";
echo "<td onclick='redirect()'>" . $property['id_Admin'] . "</td>";
echo "<td onclick='redirect()'>" . $property['username_Admin'] . "</td>";
echo "<td onclick='redirect()'>" . $property['password_Admin'] . "</td>";
echo "</tr>";
}
echo "</table>";
?>
I’ve done a lot of research and changed the code several times to see if something worked but nothing. I’m sure all the fields are the same as in the database.
Thank you in advance, Redcandy.