select * from table1 left join table2 on table1.id = table2.other_id
Featured Properties
0) {
$where = " location in ($location) ";
?>
$i = 0;
while($rw = mysql_fetch_array($r))
{
If ($rw['image_copy'] != 0){
$image = "/images/property/".GetImageFolder($rw['image_copy'])."/".$rw['image_copy']."-1.jpg";
}else{
$image = "/images/property/".GetImageFolder($rw['property_id'])."/".$rw['property_id']."-1.jpg";
}
?>
$beds = '';
$valid_beds = '';
$result = mysql_query("SELECT id FROM properties WHERE ".$where." AND property_code = '".$rw['property_code']."' ORDER by bedrooms asc") or die("SELECT Query failed: " . mysql_error());
//Echo "SELECT id FROM properties WHERE ".$where." AND property_code = '".$rw['property_code']."' ORDER by bedrooms asc";
If (mysql_num_rows($result) > 1) {
While($row = mysql_fetch_array($result)){
$valid_beds .= $row['id'].',';
}
$beds = substr($valid_beds, 0, -1);
}else{
$row = mysql_fetch_array($result);
$beds = $row['id'];
}
$p1 = $rw['property_title'];
if (strlen($p1) > 28) { $pi = substr($p1, 0, 27) . '..'; }
?>
" class="link">
" class="link"> If (trim($rw['title']) == '') { Echo $pi; }else{ Echo $rw['title']; } ?>
" class="link">
$f = mysql_query("SELECT distinct bedrooms FROM properties WHERE ".$where." AND property_code = '".$rw['property_code']."' ORDER BY bedrooms ASC");
If (mysql_num_rows($f) > 0) {
?>
}
?>
$i++;
}
}
if (!$where) { echo '
Fo4.'; }
?>