Código PHP:
<?
echo "<p align=center>";
echo "hola";
$dbhost = "localhost";
$dbuser = "root";
$dbpassword = "pepe";
$conectar = mysql_connect ($dbhost, $dbuser, $dbpassword);
mysql_select_db ("midb", $conectar);
$consulta = "SELECT web, comentario FROM web";
$query = mysql_query ($consulta, $conectar);
echo "<table align=center border=0 bgcolor=#6B6BFF
cellspacing=5>";
while ($reg = mysql_fetch_row($query)){
echo "<tr>";
echo "<br>";
foreach($reg as $cambia){
echo "<td>",$cambia,"</td>";
}
}
echo "</table>";
?>
el error que me tira es el siguiente:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\trabajo\libro.php on line 13