表標題出現在我的網頁上,但td不出現在我的html頁面上。我試圖將while循環的結果回顯到表td中。 任何人都可以請幫忙嗎?html表php和echo
<table align= "centre" width="650" align="center">
<tr>
<th> Post:id </th>
<th> Title </th>
</tr>
<?php
include("includes.php");
$get_posts = "select * from posts";
$run_posts = mysql_query($get_posts);
while ($row_posts = mysql_fetch_array('$run_posts')) {
$post_id = $row_posts['post_id'];
$post_title = $row_posts['post_title'];
?>
<tr>
<td> <?php echo $post_id; ?> </td>
<td> <?php echo $post_title; ?> /td>
</tr>
<?php } ?> // CLOSE WHILE LOOP
</table>
是否確定行從查詢中返回?你不檢查你的代碼。 – 2014-09-02 15:22:52