"未捕获的SyntaxError:意外的令牌<"在while循环中

时间:2017-04-08 17:02:01

标签: javascript php html

我有错误"未捕获的SyntaxError:意外的令牌<"在我的浏览器中,当我加载我的PHP文件。我得到它时附加了代码示例。错误出现在WHILE循环的第一行" echo"

                <table class="table">
                    <thead>
                        <tr>
                          <th>Pavadinimas</th>
                          <th>Šalis</th>
                          <th>Miestas</th>
                          <th>Stadionas</th>
                          <th id='date_column'>Data</th>
                          <th>Aprašymas</th>
                          <th>Registracija</th>
                        </tr>
                    </thead>

                    <tbody>
                        <script>
                                if (document.getElementById("coming_events").checked === false & document.getElementById("active_registration").checked === false){
                                    <?php
                                        $sql = "SELECT pavadinimas_lt, salis, miestas, stadionas, aprasymas, data_nuo, data_iki, reg_data_nuo, reg_data_iki FROM varzybos";
                                        $result = mysqli_query($conn, $sql);
                                        if (mysqli_num_rows($result) > 0) {
                                            // output data of each row
                                            while($row = mysqli_fetch_assoc($result)) {
                                                echo "<tr><td><a href='admin/varzybos_info.php' title='Varžybų informacija'><span>" . $row["pavadinimas_lt"]. "</span></a></td><td>"
                                                . $row["salis"]."</td><td>" . $row["miestas"]."</td><td>" . $row["stadionas"]."</td><td id='date_column'>" . $row["data_nuo"]."<br>".$row["data_iki"].
                                                "</td><td id='about_column'>". $row["aprasymas"]."</td><td>" . $row["reg_data_nuo"]."<br>".$row["reg_data_iki"];
                                            }
                                        } else {
                                            echo "0 results";
                                         }
                                    ?>;
                                }
                        </script>
                    </tbody>
                </table>

0 个答案:

没有答案