
<html>
<body>
<?php
//conexion BD
$link = mysql_connect("localhost", "basedatos", "micontrasenna");
mysql_select_db("cuestionario", $link);
$result = mysql_query("SELECT AVG (Respuesta01) FROM Formulario", $link);
if ($row = mysql_fetch_array($result)){
echo "<table border = '1'> \n";
echo "<tr> \n";
echo "<td><b>Media</b></td> \n";
echo "</tr> \n";
do {
echo "<tr> \n";
echo "<td>".$row["Respuesta01"]."</td> \n";
echo "</tr> \n";
} while ($row = mysql_fetch_array($result));
echo "</table> \n";
} else {
echo "No hay datos para mostrar";
}
?>
</body>
</html>
A ver si a alguien se le ocurre,
Muchas gracias!