suppose i have 3 buildings

```
Building 1
Building 2
Building 3

```

i select building 1
after that my current code show all floor of building 1

after that i have all floors

```
floor 1
floor 2
floor 3
floor 4

```

then i select floor 1 

now i have 

```
flat 1
flat 1
flat 1
flat 2
flat 2
flat 2
flat 3
flat 3
flat 3
flat 4 
flat 4
flat 4

```

this is showing wrong because it is showing all buildings of flats 

and i want building 1 floor 1 flats only 

how can i do this please help me 
thanks

and i think some changes to here in link but i dont know how can i do this

```
echo "<td><div align='center'><a href=\"floors.php?id=" . $row['buildingname'] . "\" class=\"style2\"><img src='images/floor.gif' width='60' height='90'></a><p>" . $row['floorno'] . "</p><div></td>";

```

i want like this 
link like this 

floors.php?id=building1&floor1

after that all flat is showing perfect 

floors.php?id=" . $row['buildingname'] ." and " . $row['floorno'] ."

this is complete code
and this is showing floors of selected building by get id 

```
<?php

     $id = $_GET['id'];

        $max_results = 8;

        $from = (($page * $max_results) - $max_results);

        if(empty($_POST)) {
                      $query = "SELECT * FROM floors  where buildingname='$id' ORDER BY floorno ASC LIMIT $from, $max_results ";
        } 
        $result = mysql_query("SET NAMES utf8"); //the main trick
        $result = mysql_query($query) or die(mysql_error());
        $rows = mysql_num_rows($result);

        $count=0;
        while($row = mysql_fetch_array($result))
            {
                if($count%4==0)
                {
                echo "<tr/>";
                echo "<tr>";
                }

                echo "<td><div align='center'><a href=\"floors.php?id=" . $row['buildingname'] . "\" class=\"style2\"><img src='images/floor.gif' width='60' height='90'></a><p>" . $row['floorno'] . "</p><div></td>";

                $count++;

        }

        echo "</tr>";
        echo "</table>"; 
        echo '</div>';
        ?>

```