私はこのPHPコードを持っていますが、その下のhtmlレイアウトと統合しようとしていますが、私はそれを理解できません。 コードはすべてのステータスポストを取得し、それらを順番に表示します。ステータス投稿には コメントがあるか、複数のコメントがある可能性があります。このPHPループ内でこのhtmlをどのように統合できますか?
あなたは、私はPHPコードで左のノート、私はHTMLで左のノートを読めば、あなたは私が何とか状況ポストのテーブルセル
の内側にコメントを配置する必要があり を直面しています、問題が表示されます下の画像には1つのステータスポストとそのポストに対する3つのコメントがありますが、私がしようとしているのは、ステータスポストの右側にネストされる自分のテーブルにコメントを表示することです。だから、あなたがその記事の下部にあるテーブルの枠線を参照してくださいトップ@ステータスポストに、その境界線はそのポストのための最後のコメント以下でなければならない、もう少し理にかなっての希望今
alt text http://i32.tinypic.com/2afnc3l.jpg
<?PHP
$last_id = 0;
echo '<table width="400">';
while ($row = mysql_fetch_array($res)) {
//start output of new status post and comments
if ($row['0'] != $last_id) {
echo 'status post stuff'
}
//start output of new status post and comments
//output comment here
$last_id = $row['0'];
if($row['commentid'] != ''){
echo 'status COMMENT for above status post'
}
//END output comment here
}
echo '</table>';
?>
<table width="400">
<!-- begin status post -->
<tr>
<td width="99" valign="top" style="border-bottom: 1px solid rgb(204, 204, 204); margin: 0px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px;"> <div class="imageSub" style="width: 90px;"> <img class="female" src="http://cache2.mycrib.net/images/image_group66/0/43/t_6871399b0962b5fb4e29ce477541e165950078.jpg" alt="Something" width="90"/> </div></td>
<td width="489" style="border-bottom: 1px solid rgb(204, 204, 204); margin: 0px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px;">so and so said blah blah blah @ wee hours of the moring! <BR>
<!-- begin comment -->
<table width="90%" style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px;">
<tr>
<td width="14%" rowspan="2" valign="top"><img class="male" src="http://cache2.mycrib.net/images/image_group34/0/39/T_653807517aff2b1f5662d865b40d87d527c8eb.jpg" alt="Something" width="45"/></td>
<td width="86%">Date Posted</td>
</tr>
<tr>
<td>Comment text</td>
</tr>
</table>
<!-- end comment -->
</td>
</tr>
<!-- end status post -->
</table>
私はあなたに正直になるだろう、私はこの問題は、あなたが直面していることが何であるかを理解していません。詳しく教える? :) – falstro
画像を追加しましたもう少し説明しました – JasonDavis