Ver Mensaje Individual
  #11 (permalink)  
Antiguo 16/06/2012, 19:41
towi62
 
Fecha de Ingreso: abril-2005
Mensajes: 253
Antigüedad: 19 años
Puntos: 0
Respuesta: problema de logica

Cita:
Iniciado por gldelossantos Ver Mensaje
Este es tu codigo arreglado

//desde aqui comienzo a enviar los valores que se pasan por la url
if (!$_GET){

if (mysql_num_rows($respuesta) > 0){
echo "<table><tr>";
$cont=0;
while ($row = mysql_fetch_assoc($respuesta)){
if($row['imagen']!=''){
echo '<td>
<div style="text-align:left">
<IMG style="WIDTH: 120px; HEIGHT: 81px" src="img/'.$row['imagen'].'">
<A href="productos.php?id='.$row['id'].'">'.vermas.'</A>
</div>
</td>';
$cont++;
if ($cont==3){
echo '</tr><tr>';
$cont=0;
}
}
}
} else {
while ($row = mysql_fetch_assoc($respuesta)){
if($row['imagen']!=''){
echo '<tr>
<td>
<IMG style="WIDTH: 10px; HEIGHT: 11px" src="img/'.$row['imagen'].'">
<A href="productos.php?id='.$row['id'].'">'.Ver mas.'</A>
</td>';
}
}
}
echo "</tr>
</table>";
}
//Desde aqui veo los detalles del producto
else {

$imagen=$_GET["id"];


$sql="SELECT * FROM productos WHERE id='".$id."'";

if (mysql_num_rows($respuesta) > 0){


while ($row = mysql_fetch_assoc($respuesta)){
if($row['imagen']!=''){
echo '<table><td>
<div style="text-align:left">
<IMG style="WIDTH: 120px; HEIGHT: 81px" src="img/'.$row['imagen'].'">
<A href="comprar.php?id='.$row['id'].'">'.comprar.'</A>
</div>
</td>
</table>';

}
}

}
}





espero te funcionee

Sigue con el mismo problema amigo.
__________________
:cool: aprendiz :cool: