rendered paste bodyselect * from table1 left join table2 on table1.id = table2.other_id<!-- <div id="contentfeatured">// <h1>Featured Properties</h1>// <p>All ourms.</p></div> --><div id="contentfeatured"> <h1>Featured Properties</h1><?php$r = mysql_query("SELECT f.id, f.property_id, p.image_copy, f.title, p.title as property_title, p.property_code, f.description, left(p.short_description, 57) as short_description, p.bedrooms, f.link_url FROM featured_properties f left join featured_properties_to_web_sites on featured_property_id = id left join properties p on f.property_id = p.id WHERE property_id != 0 AND f.location_id IN ($location) ORDER BY sort_order ASC LIMIT 3");If (mysql_num_rows($r) > 0) { $where = " location in ($location) ";?><script language="JavaScript"><!--function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0;}//--></script><style>.jumpmenu { background-color: #FFFFFF; color: #000000; font-weight: normal; font-family: Arial, Helvetica, sans-serif; font-size: 8pt; width: 150px; margin-top:2px;}div#featured { width: 150px; float: left; overflow:hidden; display: block; margin: 1px 5px 1px 1px; padding: 0px 0px 1px 1px;}div#featuredhotel { width: 150px; float: left; overflow:hidden; display: block; margin: 1px 5px 1px 1px; padding: 0px 0px 1px 1px;}div#featuredcondo { width: 150px; float: left; overflow:hidden; display: block; margin: 1px 5px 1px 1px; padding: 0px 0px 1px 1px;}div#featuredhome { width: 150px; float: left; overflow:hidden; display: block; margin: 1px 0px 1px 1px; padding: 0px 0px 1px 1px;}</style><? $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"; } ?> <div id="featured"><? $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) . '..'; } ?> <a href="<? If (trim($rw['link_url']) == '') { Echo "/results.php?location=".$location."&featured=".$beds; }else{ Echo $rw['link_url']; } ?>" class="link"><img src="<?=$image;?>" height="107" width="150" align="left" border=0/></a> <p><a href="<? If (trim($rw['link_url']) == '') { Echo "/results.php?location=".$location."&featured=".$beds; }else{ Echo $rw['link_url']; } ?>" class="link"><? If (trim($rw['title']) == '') { Echo $pi; }else{ Echo $rw['title']; } ?></a> <a href="<? If (trim($rw['link_url']) == '') { Echo "/results.php?location=".$location."&featured=".$beds; }else{ Echo $rw['link_url']; } ?>" class="link"></a></p><? $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) { ?><!-- <select name="menu1" class="jumpmenu" onChange="MM_jumpMenu('parent',this,0)"> <option selected>Select Unit Type</option> <? while($fw = mysql_fetch_array($f)) { $beds = ''; $valid_beds = ''; $result = mysql_query("SELECT id FROM properties WHERE ".$where." AND bedrooms = ".$fw['bedrooms']." AND property_code = '".$rw['property_code']."' ORDER BY bedrooms ASC") or die("SELECT Query failed: " . mysql_error()); 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']; } ?> <option value="/results.php?location=<?=$location;?>&bedrooms=<?=$fw['bedrooms'];?>&featured=<?=$beds;?>"><?=PrintBedroomString2($fw['bedrooms']);?></option> <? } ?> </select> --> <? }?> </div><? $i++;}}if (!$where) { echo '<span class="text">Fo4</b>.</span>'; }?></div>