最近在测试我的sql查询脚本后,我遇到了一个问题.我的if语句中的大于登录结束了php,然后将其余代码输出为html.
这是我的代码.(它位于"poll.html",一个带有php代码的html文件)
<div class="pollcont">
<?php
$pollrow = mysql_query("SELECT * FROM `Activepoll` ORDER BY `id` DESC LIMIT 1");
$rows = mysql_num_rows($pollrow);
if($rows > 0){ Do this stuff }; ?> </div>
Run Code Online (Sandbox Code Playgroud)
而不是完成if语句, 0){ Do this stuff }; ?>输出到浏览器.
为什么会发生这种情况,如何更改此脚本以便脚本运行?