Ver Mensaje Individual
  #3 (permalink)  
Antiguo 19/03/2011, 13:18
Avatar de ricardo_tu
ricardo_tu
 
Fecha de Ingreso: noviembre-2010
Ubicación: Mas aca del mas alla
Mensajes: 222
Antigüedad: 13 años, 5 meses
Puntos: 32
Respuesta: SOS desesperado

gnzsoloyo, agradezco enormemente tu interés y respuesta, y mi problema se resolvió con

SELECT * FROM propiedades WHERE destino='vacaciones'.

Como aporte comento que se trata de mostrar una búsqueda en campos horizontales y verticales (es una típica muestra de productos). Dejo el código completo.

Query Mysql y php muestra resultados en forma de campos horizontales y verticales para
mostrar productos con php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
<style type="text/css">
<!--
.color {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
}
.colorCopia {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
color: #333333;
}
.colorlinea {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: bold;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
border-top-color: #333333;
border-right-color: #333333;
border-bottom-color: #333333;
border-left-color: #333333;
color: #333333;
}
.colorprecio {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
color: #333333;
}
.colorfondo {
background-color: #EEEEEE;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: none;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #000000;
border-right-color: #000000;
border-bottom-color: #000000;
border-left-color: #000000;
}
-->
</style>
</head>

<body>
<table width="295" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="logo.gif" width="990" height="200" /></td>
</tr>
</table>

<?php

include("conexion.php");
$busqueda= "vacaciones";
//$result = mysql_query("SELECT * FROM propiedades order by id DESC "); para busquedas totales
$result = mysql_query("SELECT * FROM propiedades WHERE destino='vacaciones'"); //para busquedas selectivas

$cols = 3; // numero de columnas
$num=mysql_num_rows($result);

$filas = floor($num / $cols); // divide los resusltados y redondea los decimales

echo "<table>";
for ($i = 0; $i <= $filas; $i++)

{
echo "<tr>";

for ($j=0; $j < $cols ; $j++)
{
$row=mysql_fetch_array($result);
if ($row["id"] == "")
{
echo "<td>&nbsp</td>";
}
else
{
?>

</div>

<TD>


<div align="center" id="principal">
<? echo "<img src=".$row['foto']." height=225 width=300 border=1>"; ?><BR><!--muestra foto -->

<font face="Geneva, Arial, Helvetica, sans-serif" size="3">
<!--desde aca hacia abajo muestra datos del producto -->
<table width="328" height="209" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="328" valign="top"><table width="302" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#EEEEEE" class="colorfondo">
<tr>
<td><table width="295" height="194" border="0" cellpadding="0" cellspacing="0" align="center">
<tr class="color">
<td width="23" height="36" align="left" bgcolor="#EEEEEE">Cod</td>
<td width="32" align="left" bgcolor="#EEEEEE" class="colorCopia"><? echo $row["id"]; ?></td>
<td width="46" align="left" bgcolor="#EEEEEE" class="colorCopia"><? echo $row["tipo"]; ?></td>
<td width="136" align="center" bgcolor="#EEEEEE" class="colorCopia"><? echo $row["sector"]; ?></td>
<td width="58" height="36" align="right" bgcolor="#EEEEEE" class="colorCopia"><? echo $row["comuna"]; ?></td>
</tr>
<tr>
<td height="23" colspan="3" align="left" valign="top" bgcolor="#EEEEEE" class="colorCopia"><? echo $row["destino"]; ?></td>
<td height="23" colspan="2" align="left" valign="top" bgcolor="#EEEEEE" class="colorCopia"><? echo $row["periodo"]; ?></td>
</tr>
<tr>
<td height="55" colspan="5" align="left" valign="middle" bgcolor="#EEEEEE" class="colorlinea"><? echo $row["presentacion"]; ?></td>
</tr>
<tr>
<td colspan="4" align="left" bgcolor="#EEEEEE" class="colorprecio">VALOR : <? echo $row["moneda"]; ?><? echo $row["valor"]; ?></td>
<td align="left" bgcolor="#EEEEEE" class="color">&nbsp;</td>
</tr>
<tr>
<td colspan="5" align="center" bgcolor="#EEEEEE"><table width="290" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="123" align="left"><form id="form2" name="form2" method="post" action="contacto.php">
<input type="image" name="Submit2" value="Enviar" src="contacto.gif" />
<input name="codigo" type="hidden" id="codigo" value="<?Php echo $row["id"]; ?>" />
</form></td>
<td width="167" align="left"><form id="form1" name="form1" method="post" action="">
<input type="image" name="Submit" value="Enviar" src="mas.gif" />
<input name="textfield2" type="hidden" value="echo $row[&quot;id&quot;];" />
</form></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</div></TD>

<?php
} //end del else
} //end del for con $j
echo "</tr>";
} //end del for con $i.
echo "</table>";

mysql_close($conexion);
?>
<label></label>
</body>
</html>