
26/08/2002, 14:08
|
| | Fecha de Ingreso: agosto-2002 Ubicación: Santiago de Chile
Mensajes: 136
Antigüedad: 22 años, 6 meses Puntos: 1 | |
necesito ayuda en consulta a mysql. help!!! estoy tratando de hacer una consulta a una base de datos, y me tira el sgte. error: Parse error on line 7
este es el script:
<html>
<body>
<?php
$link = mysql_connect("localhost", "xxx", "xxx");
mysql_select_db("site85_1");
$result = mysql_query("select nombre, precio from productos ", $link) esta es la linea 7: if ($row = mysql_fetch_array($result)){ echo "<table border = '1'> \n";
echo "<tr> \n";
echo "<td><b>Nombre</b></td> \n";
echo "<td><b>Precio</b></td> \n";
echo "</tr> \n";
do {
echo "<tr> \n";
echo "<td>".$row["nombre"]."</td> \n";
echo "<td>".$row["precio"]."</td>\n";
echo "</tr> \n";
} while ($row = mysql_fetch_array($result));
echo "</table> \n";
} else {
echo "¡ La base de datos está vacia !";
}
?>
</body>
</html> |