Q:

Syntax Error for Two PHP while SQL fetch?

I have created a while fetch (mysqli_fetch_assoc) inside another while fetch hope to save space. My editing software is Dreamweaver and it said no error. But when I run the php on browser. It says "Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\include\components\matchingsearch.php on line 33".
I remove the whole php search section from my php file and the error didnt not show up again
<?php
    if($featuresdb == false) {die("ERROR: Could not connect. " . mysqli_connect_error());}
    mysqli_set_charset($featuresdb, "utf8");
    $bigsql = "SELECT * FROM options WHERE event = 'search'";
    $bigresult = mysqli_query($featuresdb, $bigresult);
?>
<div class="container-matching-nav<?php if($_SESSION['username'] == "") {echo ' disable';}?>"><div class="row-profile">
<a href="#table"><div class="column-profile" style="background:green;border-radius:5px"><p style="text-decoration:black;color:black">尋找</p></div></a>
<a href="pages/account/programmes.php"><div class="column-profile" style="background:blue;border-radius:5px"><p style="text-decoration:none;color:white">申請</p></div></a>
</div></div>
<div class="container-table<?php if($_SESSION['username'] == "") {echo ' disable';}?>">
<div id="table" class="text-heading">補習尋找系統</div>
<table class="table" align="center" style="font-size:80%;border:1px solid black;width:100%;max-width:700px;line-height:30px">
<tr style="background:grey"><th>標準</th><th>你的標準</th></tr>
<form action="" method="post">
<?php
    while($bigrows = mysqli_fetch_assoc($bigresult)) {
        $options = $bigrows['options'];
    ?>
        <tr><td><?php echo $bigrows['chinese'];?></td>
        <td><select name="<?php echo $bigrows['options'];?>">
            <?php           
            $smallsql = "SELECT * FROM data WHERE item = '$options'";
            $smallresult = mysqli_query($featuresdb, $smallsql);
            while($rows = mysqli_fetch_assoc($smallresult)) {
            $rowsvar = $rows['subject'];
            ?>
            <option value="<?php echo $rowsvar?>" <?=$_POST['subject'] == $rowsvar ? ' selected="selected"' : '';?>><?php echo $rowsvar;?></option>
            <?php } ?>
            </select></td>
    <? } ?>
<tr><td colspan="10"><a href="#result"><input class="btn button" type="submit" value="Search" name="filter" /></a></td></tr>
</form></table></div>

I wanted it to use the variables i stored from the database to find other results in another table, displaying data from two tables at the same time. But errors pops up

A:

<? } ?>

Change the last line of the code to 
<?php } ?>

You have missed the php after question mark

