Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/04/2011, 15:01
nzick
 
Fecha de Ingreso: enero-2011
Ubicación: Colombia
Mensajes: 61
Antigüedad: 13 años, 3 meses
Puntos: 1
error al mostrar datos de tabla Warning: mysql_fetch_row() expects parameter 1 to be

hola, estoy intentando mostrar en la pagina todos los datos que tengo en una tabla de la base de datos

la tabla tiene los siguientes campos numero, placa, concesionario, nombre, estado

estoy intentando mostrar en pantalla los ultimos 4 campos, pero al hacerlo me sale el siguiente error

Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in C:\wamp\www\stm_placas_prueba\listar_auto.php on line 48

aca esta el codigo

ojala me puedan ayudar, gracias

<body>
<table width="237.5" border="1" align="center">
<tr>
<th scope="col"><img src="banner.JPG" width="891" height="268" /></th>
</tr>
<tr>
<td><div align="center" class="Estilo3 Estilo5">
<p>LISTADO DE PLACAS - AUTOMOVILES </p>
<p>
<?PHP
$link = mysql_connect("localhost","root");
$conn = mysql_select_db ("registro");
if (! $conn)
{echo "error de bd";}

$result = mysql_query("SELECT placa,concesionario,nombre,estado FROM autos", $link);

echo "<table border = '1' align='center'> \n";

echo "<tr> \n";

echo "<td><b>PLACA</b></td> \n";

echo "<td><b>CONCESIONARIO</b></td> \n";

echo "<td><b>NOMBRE</b></td> \n";

echo "<td><b>ESTADO</b></td> \n";

echo "</tr> \n";

while ($row = mysql_fetch_row($result)){

echo "<tr> \n";

echo "<td>$row[1]</td> \n";

echo "<td>$row[2]</td> \n";

echo "<td>$row[3]</td> \n";

echo "<td>$row[4]</td> \n";

echo "</tr> \n";

}

echo "</table> \n";

?>

</p>
</div></td>
</tr>
</table>
</body>
</html>