<?php 
$search = mysql_real_escape_string(stripslashes($_REQUEST['search'])); 
$search="%".$search."%";
?>

<?php 
$sql1 = "SELECT * FROM rooms WHERE (name LIKE '$search' OR text LIKE '$search') AND publish='yes' AND publisha='yes' ORDER BY priority";
$result1 = mysql_query($sql1);
while ($myrow=mysql_fetch_array($result1)) {
$roomid=$myrow['insert_id'];
$roompage=$myrow['page'];
			
$result2 = mysql_query("SELECT * FROM rooms WHERE insert_id='$roomid' AND lang_id='$lang'",$dbh);
$myrow=mysql_fetch_array($result2);
$room=$myrow['name'];
?>
<div> <a href="rooms.<?php echo $roomid ?><?php echo $roompage ?>" class="links"> &raquo; <?php echo $room ?></a>   </div>
<?php }?>

<hr>

<?php 
$sql3 = "SELECT * FROM info WHERE (name LIKE '$search' OR text LIKE '$search') AND publish='yes' ORDER BY priority";
$result3 = mysql_query($sql3);
while ($myrow=mysql_fetch_array($result3)) {
$categoryid=$myrow['category_id'];
			
$sql4 = "SELECT * FROM infocategories WHERE insert_id='$categoryid' AND lang_id=1 AND publish='yes' ORDER BY priority";
$result4 = mysql_query($sql4);
while ($myrow=mysql_fetch_array($result4)) {
$isids2=$myrow['insert_id'];
$page2=$myrow['page'];
	
$result5 = mysql_query("SELECT * FROM infocategories WHERE insert_id='$isids2' AND lang_id='$lang'",$dbh);
$myrow=mysql_fetch_array($result5);
$infocat=$myrow['title'];
?>

<div> <a href="<?php echo $page2 ?>" class="links"> &raquo; <?php echo $infocat ?></a>   </div>
<?php }?>
<?php }?>