BIBLIOTECA
{source}
<?php
// Conexion a servidor
$link = mysqli_connect('localhost', 'chgerman_circulo', 'w0bYq98bC4');
if (!$link) {
//echo "No conectado a servidor";
} else {
//echo "Conectado a servidor";
}
// Conexion a bbdd
$db_select = mysqli_select_db($link, 'chgerman_biblioteca');
if (!$db_select) {
//echo "Conectado a base de datos";
} else {
//echo "Conectado a base de datos";
}
mysqli_query($link, "SET NAMES utf8");
$query = "SELECT AUTOR, TITULO, TEJUELO FROM biblioteca ORDER BY TITULO, AUTOR, TEJUELO";
$result = mysqli_query($link, $query);
echo "<table border='1'><th>AUTOR</th><th>TITULO</th><th>TEJUELO</th>";
while ($row = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td>".$row['AUTOR']."</td>";
echo "<td>".$row['TITULO']."</td>";
echo "<td>".$row['TEJUELO']."</td>";
echo "</tr>";
}
echo "</table>";
?>
{/source}