[英]For some reason when i add this to my code I get the unexpected end of file error. But I can't figure out what's wrong with this code
这是产生错误的代码。
<div>
<?php while($row2 = mysqli_fetch_assoc($get_comment)){?>
<div class="comment">
<p><?php echo $row2['comment']?></p>
</div>
<?php}?>
</div>
问题在这里<?php}?>
。 你应该在 php 标签之间使用一个空格,比如<?php } ?>
例如,如果你这样写<?phpecho "Hello";?>
这就是无效的。 因为编译器不会找到任何像<?php
这样的起始标签,因为它是<?phpecho
。 在你的情况下它是<?php}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.