Click to See Complete Forum and Search --> : Complex query gives no results, why?


Perfidus
11-18-2003, 09:41 PM
I get a white page, with a three column table...
Nothing else!

<?
$link = mysql_connect('mysql.gestionar.info', 'aa1126', 'massiveA');
mysql_select_db("aa3968",$link);
$result = mysql_query("SELECT accesplaya, ascensor, cafetera, Calefaccion, zonajuegos, equipomus, lavadora, microhondas, tele, Aire_Acond, basket, cajafuerte, entornoint, futbol, horno, lavavajillas, minusvalidos, zonacomer, parabolica, Mascota, tranquilo, video, piscina, zonaocionoc, Garaje, Tenis, calific FROM DatosInmueble WHERE (Inmo='Laclau')", $link);
?>

<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<?
while($row = mysql_fetch_array($result)) {
foreach($row as $column)
?>
<td><img src="images/thumb/<? echo $row['Ref']; ?>thumb_1.jpg" width="150" height="112"></td>
<td><font color="#000000" size="1" face="Arial, Helvetica, sans-serif"><? echo $row['Descripcion']; ?></font></td>
<td><table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>
<? if ($row['accesplaya']==1){echo "<img src='images/iconosact/accesoplaya.gif' width='24' height='24' alt='ligging aan het strand'>";}else{echo "<img src='images/iconosinact/accesoplaya.gif' width='24' height='24' alt='ligging aan het strand'>";}?>
</td>
<td>
<? if ($row['ascensor']==1){echo "<img src='images/iconosact/ascensor.gif' width='24' height='24' alt='Lift
'>";}else{echo "<img src='images/iconosinact/ascensor.gif' width='24' height='24' alt='Lift'>";}?>
</td>
<td>
<? if ($row['cafetera']==1){echo "<img src='images/iconosact/cafetera.gif' width='24' height='24' alt='Koffiezetapparaat
'>";}else{echo "<img src='images/iconosinact/cafetera.gif' width='24' height='24' alt='Koffiezetapparaat'>";}?>
</td>
<td>
<? if ($row['Calefaccion']==1){echo "<img src='images/iconosact/calefaccion.gif' width='24' height='24' alt='Verwarming
'>";}else{echo "<img src='images/iconosinact/calefaccion.gif' width='24' height='24' alt='Verwarming'>";}?>
</td>
<td>
<? if ($row['zonajuegos']==1){echo "<img src='images/iconosact/zonajuego.gif' width='24' height='24' alt='Speelplaats
'>";}else{echo "<img src='images/iconosinact/zonajuego.gif' width='24' height='24' alt='Speelplaats'>";}?>
</td>
<td>
<? if ($row['equipomus']==1){echo "<img src='images/iconosact/hifi.gif' width='24' height='24' alt='Radio
'>";}else{echo "<img src='images/iconosinact/hifi.gif' width='24' height='24' alt='Radio'>";}?>
</td>
<td>
<? if ($row['lavadora']==1){echo "<img src='images/iconosact/lavadora.gif' width='24' height='24' alt='Wasmachine
'>";}else{echo "<img src='images/iconosinact/lavadora.gif' width='24' height='24' alt='Wasmachine'>";}?>
</td>
<td>
<? if ($row['microhondas']==1){echo "<img src='images/iconosact/microhondas.gif' width='24' height='24' alt='Magnetron
'>";}else{echo "<img src='images/iconosinact/microhondas.gif' width='24' height='24' alt='Magnetron'>";}?>
</td>
<td>
<? if ($row['tele']==1){echo "<img src='images/iconosact/tv.gif' width='24' height='24' alt='TV
'>";}else{echo "<img src='images/iconosinact/tv.gif' width='24' height='24' alt='TV'>";}?>
</td>
</tr>
<tr>
<td>
<? if ($row['Aire_Acond']==1){echo "<img src='images/iconosact/airco.gif' width='24' height='24' alt='Airconditioning
'>";}else{echo "<img src='images/iconosinact/airco.gif' width='24' height='24' alt='Airconditioning'>";}?>
</td>
<td>
<? if ($row['basket']==1){echo "<img src='images/iconosact/basket.gif' width='24' height='24' alt='Basketbalveld
'>";}else{echo "<img src='images/iconosinact/basket.gif' width='24' height='24' alt='Basketbalveld'>";}?>
</td>
<td>
<? if ($row['cajafuerte']==1){echo "<img src='images/iconosact/cajafuerte.gif' width='24' height='24' alt='Kluisje
'>";}else{echo "<img src='images/iconosinact/cajafuerte.gif' width='24' height='24' alt='Kluisje'>";}?>
</td>
<td>
<? if ($row['entornoint']==1){echo "<img src='images/iconosact/entornointeres.gif' width='24' height='24' alt='Mooie omgeving
'>";}else{echo "<img src='images/iconosinact/entornointeres.gif' width='24' height='24' alt='Mooie omgeving'>";}?>
</td>
<td>
<? if ($row['futbol']==1){echo "<img src='images/iconosact/futbol.gif' width='24' height='24' alt='Voetbalveld
'>";}else{echo "<img src='images/iconosinact/futbol.gif' width='24' height='24' alt='Voetbalveld'>";}?>
</td>
<td>
<? if ($row['horno']==1){echo "<img src='images/iconosact/horno.gif' width='24' height='24' alt='Oven
'>";}else{echo "<img src='images/iconosinact/horno.gif' width='24' height='24' alt='Oven'>";}?>
</td>
<td>
<? if ($row['lavavajillas']==1){echo "<img src='images/iconosact/lavavajillas.gif' width='24' height='24' alt='Vaatwasser
'>";}else{echo "<img src='images/iconosinact/lavavajillas.gif' width='24' height='24' alt='Vaatwasser'>";}?>
</td>
<td>
<? if ($row['minusvalidos']==1){echo "<img src='images/iconosact/lavavajillas.gif' width='24' height='24' alt='Toegankelijk voor gehandicapten
'>";}else{echo "<img src='images/iconosinact/lavavajillas.gif' width='24' height='24' alt='Toegankelijk voor gehandicapten'>";}?>
</td>
<td>
<? if ($row['zonacomer']==1){echo "<img src='images/iconosact/zonacomercial.gif' width='24' height='24' alt='Winkel centrum
'>";}else{echo "<img src='images/iconosinact/zonacomercial.gif' width='24' height='24' alt='Winkel centrum'>";}?>
</td>
</tr>
<tr>
<td>
<? if ($row['parabolica']==1){echo "<img src='images/iconosact/parabolica.gif' width='24' height='24' alt='Satelliet tv
'>";}else{echo "<img src='images/iconosinact/parabolica.gif' width='24' height='24' alt='Satelliet tv'>";}?>
</td>
<td>
<? if ($row['Mascota']==1){echo "<img src='images/iconosact/perro.gif' width='24' height='24' alt='Huisdieren toegestaan
'>";}else{echo "<img src='images/iconosinact/perro.gif' width='24' height='24' alt='Huisdieren toegestaan'>";}?>
</td>
<td>
<? if ($row['tranquilo']==1){echo "<img src='images/iconosact/tranquilo.gif' width='24' height='24' alt='Rustige omgeving
'>";}else{echo "<img src='images/iconosinact/tranquilo.gif' width='24' height='24' alt='Rustige omgeving'>";}?>
</td>
<td>
<? if ($row['video']==1){echo "<img src='images/iconosact/video.gif' width='24' height='24' alt='Televisie met video
'>";}else{echo "<img src='images/iconosinact/video.gif' width='24' height='24' alt='Televisie met video'>";}?>
</td>
<td>
<? if ($row['Piscina']==1){echo "<img src='images/iconosact/piscina.gif' width='24' height='24' alt='Televisie met video
'>";}else{echo "<img src='images/iconosinact/piscina.gif' width='24' height='24' alt='Televisie met video'>";}?>
</td>
<td>
<? if ($row['zonaocionoc']==1){echo "<img src='images/iconosact/ocionoct.gif' width='24' height='24' alt='Nabij gelegen nachthoreca
'>";}else{echo "<img src='images/iconosinact/ocionoct.gif' width='24' height='24' alt='Nabij gelegen nachthoreca'>";}?>
</td>
<td>
<? if ($row['Garaje']==1){echo "<img src='images/iconosact/parking.gif' width='24' height='24' alt='Parkeer gelegenheid
'>";}else{echo "<img src='images/iconosinact/parking.gif' width='24' height='24' alt='Parkeer gelegenheid'>";}?>
</td>
<td>
<? if ($row['tenis']==1){echo "<img src='images/iconosact/tenis.gif' width='24' height='24' alt='Tennisveld
'>";}else{echo "<img src='images/iconosinact/tenis.gif' width='24' height='24' alt='Tennisveld'>";}?>
</td>
<td>&nbsp;</td>
</tr>
</table></td>
</tr>

<tr>
<?
}
mysql_free_result($result);
?>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>

pyro
11-18-2003, 09:52 PM
Are you just taking all the fields? If so, you might find it easier to do it like this:

$result = mysql_query("SELECT * FROM `DatosInmueble` WHERE `Inmo`='Laclau'", $link) or die ("Could not query because ".mysql_error());Which should also tell you if there is an error quering the DB.

Perfidus
11-18-2003, 09:58 PM
Thank U for your times my friends, but I have been SOOO STUPID that I didn't realize that the record I'm comparing with Inmo=Pepe, is empty on my F*cking database!!!!
So code works but not my brain!
Is 4:56 in Spain, late enough to go bed and try to forget this f*cking PHP nightmare!
Thanks a lot for your help during the day!!!

pyro
11-18-2003, 10:00 PM
Sure thing...