1
我正在從我的數據庫中檢索帖子,但我希望<div class="welcome-text"><strong>This is my second output</strong> </div>
顯示在檢索的表格下方,但其始終顯示在上方。有沒有什麼辦法可以解決這個問題:如何訂購html和php內容的顯示
<?php
while($posts_row = mysql_fetch_assoc($posts_result))
{
echo '
<tr class="topic-post">
<td class="user-post">' . $posts_row['user_name'] . '<br/>' . date('d-m-Y H:i', strtotime($posts_row['post_date'])) . '</td>
<td class="post-content">' . htmlentities(stripslashes($posts_row['post_content'])) . '</td>
</tr>
';
}
?>
<div class="welcome-text"><strong>This is my second output</strong> </div>
將很快使用的mysqli或製備的聲明,因爲我得到這個固定
你能顯示完整的HTML,我想你不關閉表'歡迎-text'前 – AgeDeO
那是真的,我沒有在合適的位置關閉表。謝謝 – Mysterio4
提示:驗證您的HTML輸出有助於發現此類錯誤。 https://validator.w3.org/ – CBroe