Ver Mensaje Individual
  #10 (permalink)  
Antiguo 10/07/2014, 12:00
galaktico
 
Fecha de Ingreso: julio-2008
Mensajes: 57
Antigüedad: 15 años, 9 meses
Puntos: 0
Respuesta: Consulta Página Detalle / Maestro con PHP

Les paso el código con los cambios hasta ahora:

resultado.php:

<?php
include("conexion.php");

$consulta="SELECT * FROM productos";
$resultado=mysql_query($consulta);
$count_results = mysql_num_rows($resultado);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
</head>
<body>
<table width="320" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Nombre</td>
<td>Ver Detalles</td>
</tr>
<?php
while($fila=mysql_fetch_array($resultado)) { ?>
<tr>
<td><?php echo $fila["nombre"]; ?></td>
<td><a href="detalle.php?id=<?php echo $fila['id_producto']; ?>" target="_self">SI</a></td>
</tr>
<?php } ?>
</table>
</body>
</html>

Detalle.php:

<?php
include("conexion.php");
$consulta="SELECT * FROM productos where id_producto = $_GET ['id']";
$resultado=mysql_query($consulta);
$fila = mysql_fetch_assoc($resultado);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
</head>
<body>
<table width="320" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Nombre</td>
<td>Categoria</td>
</tr>
<tr>
<td><?php echo $fila["nombre"]; ?></td>
<td><?php echo $fila["categoria"]; ?></td>
</tr>
</table>
</body>
</html>

Lo resumí un poco para que no se dificulte la lectura.

Muchas gracias por la ayuda que me puedan dar.

El error es el siguiente:

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /Applications/XAMPP/xamppfiles/htdocs/detalle.php on line 5