<?php
$mysqli = new mysqli('localhost','root','alumno','radius');
if (mysqli_connect_errno()){
echo "Fallo al conectar a MySQL:";
exit();
}
$query="SELECT id,nombre,autor FROM canciones";
$stmt=$mysqli->prepare($query);
$stmt->bind_param("iss",$id,$nombre,$autor);
$stmt->execute();
$stmt->store_result();
if ($stmt->num_rows>0)
{
$stmt->bind_result($id,$nombre,$autor);
?>
<html>
<body>
<h1>LISTADO DE CANCIONES DISPONIBLE</h1><br />
<table>
<tr> <th><b>Canciones Disponibles</th><th><b>ID</th><th><b>NOMBRE</th><th><b>AUTOR</th>
</tr>
<?php
while ($stmt->fetch()){
?>
<tr>
<td> <?php echo strtoupper($id);?></td>
<td> <?php echo strtoupper($nombre);?></td>
<td> <?php echo strtoupper($autor);?></td>
</tr>
<?php
}
?>
</table>
<br>
<table>
<tr><td><a href="peticiones.php"><button btn" >Pedir una cancion...</button></a></td></tr>
</table><br>
</body>
</html>
<?php
}
else
{
?>
<?php
$mysqli->close();
?> </body>
</html>
I'm trying to select a database but the page goes blank. I do not know if he's doing something
I attach the code.