this is showing all floors of building and i want to show selected building floors how can i do this i use this link floors.php?id=Building1 but its is not working please help me
if i write in there building1 it is working fine where buildingname='building1'
if i use this one where buildingname='$id'
it is not working
how can i use like this
floors.php?id=Building1
if i enter this link then it will show all selected building result
<?php
$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'><img src='images/floor.gif' width='60' height='90'></a><p>" . $row['floorno'] . "</p><div></td>";
$count++;
}
echo "</tr>";
echo "</table>";
echo '</div>';
?>