Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to select two rows in mysql and view by get id
    primarykey
    data
    text
    <p>suppose i have 3 buildings</p> <pre><code>Building 1 Building 2 Building 3 </code></pre> <p>i select building 1 after that my current code show all floor of building 1</p> <p>after that i have all floors</p> <pre><code>floor 1 floor 2 floor 3 floor 4 </code></pre> <p>then i select floor 1 </p> <p>now i have </p> <pre><code>flat 1 flat 1 flat 1 flat 2 flat 2 flat 2 flat 3 flat 3 flat 3 flat 4 flat 4 flat 4 </code></pre> <p>this is showing wrong because it is showing all buildings of flats </p> <p>and i want building 1 floor 1 flats only </p> <p>how can i do this please help me thanks</p> <p>and i think some changes to here in link but i dont know how can i do this</p> <pre><code>echo "&lt;td&gt;&lt;div align='center'&gt;&lt;a href=\"floors.php?id=" . $row['buildingname'] . "\" class=\"style2\"&gt;&lt;img src='images/floor.gif' width='60' height='90'&gt;&lt;/a&gt;&lt;p&gt;" . $row['floorno'] . "&lt;/p&gt;&lt;div&gt;&lt;/td&gt;"; </code></pre> <p>i want like this link like this </p> <p>floors.php?id=building1&amp;floor1</p> <p>after that all flat is showing perfect </p> <p>floors.php?id=" . $row['buildingname'] ." and " . $row['floorno'] ."</p> <p>this is complete code and this is showing floors of selected building by get id </p> <pre><code>&lt;?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 "&lt;tr/&gt;"; echo "&lt;tr&gt;"; } echo "&lt;td&gt;&lt;div align='center'&gt;&lt;a href=\"floors.php?id=" . $row['buildingname'] . "\" class=\"style2\"&gt;&lt;img src='images/floor.gif' width='60' height='90'&gt;&lt;/a&gt;&lt;p&gt;" . $row['floorno'] . "&lt;/p&gt;&lt;div&gt;&lt;/td&gt;"; $count++; } echo "&lt;/tr&gt;"; echo "&lt;/table&gt;"; echo '&lt;/div&gt;'; ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload