duandang2838 2019-07-26 05:54
浏览 46
已采纳

too long

This question already has an answer here:

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

</div>
  • 写回答

1条回答 默认 最新

  • dsc7188 2019-07-26 05:57
    关注
    <? } ?>
    

    Change the last line of the code to

    <?php } ?>
    

    You have missed the php after question mark

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog