[英]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.